monei-sdk 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/dist/index.d.ts +6 -2
- package/dist/index.js +6 -1
- package/dist/services/BillService.d.ts +5 -2
- package/dist/services/BillService.js +11 -2
- package/dist/services/EvmService.d.ts +2 -1
- package/dist/services/EvmService.js +3 -0
- package/dist/services/ExchangeService.d.ts +8 -6
- package/dist/services/ExchangeService.js +14 -10
- package/dist/services/PaymentMethodService.d.ts +12 -0
- package/dist/services/PaymentMethodService.js +24 -0
- package/dist/services/SecuritiesService.d.ts +5 -0
- package/dist/services/SecuritiesService.js +9 -0
- package/dist/services/WalletService.d.ts +1 -4
- package/dist/services/WalletService.js +0 -14
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +8 -1
- package/dist/services/wallet/WalletAccount.service.d.ts +8 -0
- package/dist/services/wallet/WalletAccount.service.js +16 -0
- package/dist/services/wallet/WalletUtility.service.d.ts +8 -0
- package/dist/services/wallet/WalletUtility.service.js +15 -0
- package/dist/services/wallet/deposit.service.d.ts +13 -0
- package/dist/services/wallet/deposit.service.js +25 -0
- package/dist/services/wallet/index.d.ts +4 -0
- package/dist/services/wallet/index.js +20 -0
- package/dist/services/wallet/payout.service.d.ts +9 -0
- package/dist/services/wallet/payout.service.js +15 -0
- package/dist/types/agent.d.ts +16 -0
- package/dist/types/bills.d.ts +41 -1
- package/dist/types/deposit.d.ts +101 -0
- package/dist/types/deposit.js +2 -0
- package/dist/types/enums/deposit.enum.d.ts +19 -0
- package/dist/types/enums/deposit.enum.js +25 -0
- package/dist/types/enums/payment-method.d.ts +7 -0
- package/dist/types/enums/payment-method.js +11 -0
- package/dist/types/enums/transaction.enum.d.ts +34 -0
- package/dist/types/enums/transaction.enum.js +41 -0
- package/dist/types/evm.d.ts +12 -0
- package/dist/types/exchange.d.ts +5 -1
- package/dist/types/payment-method.d.ts +34 -0
- package/dist/types/payment-method.js +2 -0
- package/dist/types/payout.d.ts +27 -0
- package/dist/types/payout.js +2 -0
- package/dist/types/security.d.ts +0 -0
- package/dist/types/security.js +1 -0
- package/dist/types/transaction.d.ts +29 -16
- package/dist/types/wallet.d.ts +140 -6
- package/dist/types/wallet.js +7 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Mr. Monei Node.js SDK
|
|
2
2
|
|
|
3
|
-
The official Node.js SDK for Monei API - providing seamless integration with Monei's comprehensive financial services including wallets, crypto transactions, bill payments, and
|
|
3
|
+
The official Node.js SDK for Monei API - providing seamless integration with Monei's comprehensive financial services including wallets, crypto transactions, bill payments, and exchanges.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -24,8 +24,8 @@ async function main() {
|
|
|
24
24
|
const user = await sdk.user.getCurrentUser();
|
|
25
25
|
console.log(`Welcome ${user.data.firstName} ${user.data.lastName}!`);
|
|
26
26
|
|
|
27
|
-
// Get wallet
|
|
28
|
-
const wallet = await sdk.
|
|
27
|
+
// Get wallet info
|
|
28
|
+
const wallet = await sdk.walletAccount.getWallet();
|
|
29
29
|
console.log(`Naira Balance: ₦${wallet.nairaBalance.toLocaleString()}`);
|
|
30
30
|
|
|
31
31
|
} catch (error) {
|
|
@@ -38,13 +38,12 @@ main();
|
|
|
38
38
|
|
|
39
39
|
## Features
|
|
40
40
|
|
|
41
|
-
- **User
|
|
41
|
+
- **User Informations** - Profile
|
|
42
42
|
- **Wallet Operations** - Balance, funding, withdrawals, peer transfers, bank verification
|
|
43
43
|
- **EVM Wallets** - Ethereum, BSC, Polygon, Arbitrum support
|
|
44
44
|
- **Solana Wallets** - SOL and SPL token management
|
|
45
45
|
- **Bill Payments** - Airtime, data, electricity, cable TV
|
|
46
46
|
- **Crypto Exchange** - Token swaps on EVM and Solana
|
|
47
|
-
- **AI Agent** - Financial assistant with streaming support
|
|
48
47
|
- **Transaction Management** - Transaction history and tracking
|
|
49
48
|
- **Beneficiary Management** - Bank, crypto, and peer beneficiaries
|
|
50
49
|
- **Full TypeScript Support** - Complete type definitions
|
|
@@ -58,22 +57,22 @@ import MoneiSDK from 'monei-sdk';
|
|
|
58
57
|
|
|
59
58
|
const sdk = new MoneiSDK({ apiKey: 'your-api-key' });
|
|
60
59
|
|
|
61
|
-
//
|
|
62
|
-
const
|
|
60
|
+
// Generate payment link
|
|
61
|
+
const paymentResult = await sdk.deposit.generatePaymentLink({
|
|
63
62
|
amount: 5000
|
|
64
63
|
});
|
|
65
|
-
console.log(`
|
|
64
|
+
console.log(`Payment link: ${paymentResult.data.link}`);
|
|
66
65
|
|
|
67
66
|
// Peer transfer
|
|
68
|
-
await sdk.
|
|
67
|
+
await sdk.payout.peerTransfer({
|
|
69
68
|
receiver: "user@example.com",
|
|
70
69
|
amount: 1000,
|
|
71
70
|
transactionPin: "123456"
|
|
72
71
|
});
|
|
73
72
|
|
|
74
73
|
// Get banks and verify account
|
|
75
|
-
const banks = await sdk.
|
|
76
|
-
const account = await sdk.
|
|
74
|
+
const banks = await sdk.walletUtility.getBanks();
|
|
75
|
+
const account = await sdk.walletUtility.verifyBankAccount({
|
|
77
76
|
accountNumber: "1234567890",
|
|
78
77
|
bank: "058" // GTBank code
|
|
79
78
|
});
|
|
@@ -125,6 +124,9 @@ console.log(`Signature: ${transferResult.data.signature}`);
|
|
|
125
124
|
### 4. Bill Payments
|
|
126
125
|
|
|
127
126
|
```typescript
|
|
127
|
+
// Get Available Electricity Billers
|
|
128
|
+
const electricityBillersResult = await sdk.bills.getElectricityBiller();
|
|
129
|
+
|
|
128
130
|
// Buy airtime
|
|
129
131
|
const airtimeResult = await sdk.bills.buyAirtime({
|
|
130
132
|
phoneNumber: "08012345678",
|
|
@@ -281,6 +283,10 @@ interface MoneiConfig {
|
|
|
281
283
|
|
|
282
284
|
- `sdk.user` - User profile and management
|
|
283
285
|
- `sdk.wallet` - Wallet and financial operations
|
|
286
|
+
- `sdk.deposit` - Deposit operations through different channels
|
|
287
|
+
- `sdk.payout` - Payout financial operations
|
|
288
|
+
- `sdk.walletUtility` - Banking and wallet utilities
|
|
289
|
+
- `sdk.paymentMethod` - Processing Financial operaios with payment methods(Automatic and recurrent charges)
|
|
284
290
|
- `sdk.evm` - EVM blockchain operations
|
|
285
291
|
- `sdk.solana` - Solana blockchain operations
|
|
286
292
|
- `sdk.transactions` - Transaction history
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { MoneiConfig } from './types';
|
|
2
|
-
import { UserService, WalletService, EvmService, SolanaService, TransactionService,
|
|
2
|
+
import { UserService, WalletService, DepositService, WalletAccountService, PayoutService, WalletUtilityService, PaymentMethodService, EvmService, SolanaService, TransactionService, BillService, ExchangeService } from './services';
|
|
3
3
|
export declare class MoneiSDK {
|
|
4
4
|
user: UserService;
|
|
5
5
|
wallet: WalletService;
|
|
6
|
+
deposit: DepositService;
|
|
7
|
+
walletAccount: WalletAccountService;
|
|
8
|
+
payout: PayoutService;
|
|
9
|
+
walletUtility: WalletUtilityService;
|
|
10
|
+
paymentMethod: PaymentMethodService;
|
|
6
11
|
evm: EvmService;
|
|
7
12
|
solana: SolanaService;
|
|
8
13
|
transactions: TransactionService;
|
|
9
|
-
agent: AgentService;
|
|
10
14
|
bills: BillService;
|
|
11
15
|
exchange: ExchangeService;
|
|
12
16
|
private client;
|
package/dist/index.js
CHANGED
|
@@ -23,10 +23,15 @@ class MoneiSDK {
|
|
|
23
23
|
// Initialize all services
|
|
24
24
|
this.user = new services_1.UserService(this.client);
|
|
25
25
|
this.wallet = new services_1.WalletService(this.client);
|
|
26
|
+
this.deposit = new services_1.DepositService(this.client);
|
|
27
|
+
this.walletAccount = new services_1.WalletAccountService(this.client);
|
|
28
|
+
this.payout = new services_1.PayoutService(this.client);
|
|
29
|
+
this.walletUtility = new services_1.WalletUtilityService(this.client);
|
|
30
|
+
this.paymentMethod = new services_1.PaymentMethodService(this.client);
|
|
26
31
|
this.evm = new services_1.EvmService(this.client);
|
|
27
32
|
this.solana = new services_1.SolanaService(this.client);
|
|
28
33
|
this.transactions = new services_1.TransactionService(this.client);
|
|
29
|
-
this.agent = new
|
|
34
|
+
//this.agent = new AgentService(this.client);
|
|
30
35
|
this.bills = new services_1.BillService(this.client);
|
|
31
36
|
this.exchange = new services_1.ExchangeService(this.client);
|
|
32
37
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { MoneiClient } from '../client/MoneiClient';
|
|
2
|
-
import { BillCategory, BillerItemsResponseDto, ValidateBillDto, AirtimePurchaseDto, DataPurchaseDto, ElectricityPaymentDto, CableTvPaymentDto, BillPaymentResponseDto,
|
|
2
|
+
import { BillCategory, BillerItemsResponseDto, ValidateBillDto, AirtimePurchaseDto, DataPurchaseDto, ElectricityPaymentDto, CableTvPaymentDto, BillPaymentResponseDto, ElectricityBillerResponseDto, PaginatedBillResponseDto, BillResponseDto } from '../types';
|
|
3
3
|
export declare class BillService {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: MoneiClient);
|
|
6
6
|
getBillerItems(category: BillCategory, billerName: string): Promise<BillerItemsResponseDto>;
|
|
7
|
+
getElectricityBiller(): Promise<ElectricityBillerResponseDto>;
|
|
7
8
|
validateBill(validateData: ValidateBillDto): Promise<any>;
|
|
8
9
|
buyAirtime(airtimeData: AirtimePurchaseDto): Promise<BillPaymentResponseDto>;
|
|
9
10
|
buyMobileData(dataData: DataPurchaseDto): Promise<BillPaymentResponseDto>;
|
|
10
11
|
buyElectricity(electricityData: ElectricityPaymentDto): Promise<BillPaymentResponseDto>;
|
|
11
12
|
subscribeCableTv(cableData: CableTvPaymentDto): Promise<BillPaymentResponseDto>;
|
|
12
|
-
|
|
13
|
+
getBills(): Promise<PaginatedBillResponseDto[]>;
|
|
14
|
+
getBillByReference(reference: string): Promise<BillResponseDto[]>;
|
|
15
|
+
generateReceipt(transactionId: string): Promise<any>;
|
|
13
16
|
}
|
|
@@ -8,6 +8,9 @@ class BillService {
|
|
|
8
8
|
async getBillerItems(category, billerName) {
|
|
9
9
|
return this.client.get(`/api/v1/bills/get-biller-items/${category}/${billerName}`);
|
|
10
10
|
}
|
|
11
|
+
async getElectricityBiller() {
|
|
12
|
+
return this.client.get('/api/v1/bills/billers/electricity');
|
|
13
|
+
}
|
|
11
14
|
async validateBill(validateData) {
|
|
12
15
|
return this.client.post('/api/v1/bills/validate', validateData);
|
|
13
16
|
}
|
|
@@ -23,8 +26,14 @@ class BillService {
|
|
|
23
26
|
async subscribeCableTv(cableData) {
|
|
24
27
|
return this.client.post('/api/v1/bills/subscribe-cable-tv', cableData);
|
|
25
28
|
}
|
|
26
|
-
async
|
|
27
|
-
return this.client.get('/api/v1/bills
|
|
29
|
+
async getBills() {
|
|
30
|
+
return this.client.get('/api/v1/bills');
|
|
31
|
+
}
|
|
32
|
+
async getBillByReference(reference) {
|
|
33
|
+
return this.client.get(`/api/v1/bills/reference/${reference}`);
|
|
34
|
+
}
|
|
35
|
+
async generateReceipt(transactionId) {
|
|
36
|
+
return this.client.get(`/api/v1/bills/receipt/${transactionId}`);
|
|
28
37
|
}
|
|
29
38
|
}
|
|
30
39
|
exports.BillService = BillService;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MoneiClient } from '../client/MoneiClient';
|
|
2
|
-
import { UserEvmPortfolioResponseDto, SendNativeTokenDto, SendNativeTokenResponseDto, SendTokenDto, SendTokenResponseDto, BalanceResponseDto } from '../types';
|
|
2
|
+
import { UserEvmPortfolioResponseDto, SendNativeTokenDto, SendNativeTokenResponseDto, SendTokenDto, SendTokenResponseDto, BalanceResponseDto, SupportedNetworkResponseDto } from '../types';
|
|
3
3
|
export declare class EvmService {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: MoneiClient);
|
|
6
|
+
getSupportedNetworks(): Promise<SupportedNetworkResponseDto>;
|
|
6
7
|
getPortfolio(chainId: number): Promise<UserEvmPortfolioResponseDto>;
|
|
7
8
|
getNativeBalance(chainId: number): Promise<BalanceResponseDto>;
|
|
8
9
|
getTokenBalance(tokenAddress: string, chainId: number): Promise<BalanceResponseDto>;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { MoneiClient } from '../client/MoneiClient';
|
|
2
|
-
import { SwapNativeToTokenDto, SwapTokenToTokenDto, SwapTokenToNativeDto,
|
|
2
|
+
import { SwapNativeToTokenDto, SwapTokenToTokenDto, SwapTokenToNativeDto, PriceResponseDto, TxHashResponseDto, SwapSolToTokenDto, SwapResponseDto, SwapTokenToSolDto } from '../types';
|
|
3
3
|
export declare class ExchangeService {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: MoneiClient);
|
|
6
|
-
|
|
6
|
+
getNativeToTokenPrice(quoteData: SwapNativeToTokenDto): Promise<PriceResponseDto>;
|
|
7
7
|
swapNativeToToken(swapData: SwapNativeToTokenDto): Promise<TxHashResponseDto>;
|
|
8
|
-
|
|
8
|
+
getTokenToTokenPrice(quoteData: SwapTokenToTokenDto): Promise<PriceResponseDto>;
|
|
9
9
|
swapTokenToToken(swapData: SwapTokenToTokenDto): Promise<TxHashResponseDto>;
|
|
10
|
-
|
|
10
|
+
getTokenToNativePrice(quoteData: SwapTokenToNativeDto): Promise<PriceResponseDto>;
|
|
11
11
|
swapTokenToNative(swapData: SwapTokenToNativeDto): Promise<TxHashResponseDto>;
|
|
12
|
-
|
|
12
|
+
getSolanaToTokenQuote(quoteData: SwapSolToTokenDto): Promise<any>;
|
|
13
|
+
getTokenToSolanaQuote(quoteData: SwapTokenToSolDto): Promise<any>;
|
|
14
|
+
getTokenToTokenQuote(quoteData: SwapTokenToTokenDto): Promise<any>;
|
|
13
15
|
swapSolToToken(swapData: SwapSolToTokenDto): Promise<SwapResponseDto>;
|
|
14
16
|
swapTokenToTokenSolana(swapData: SwapTokenToTokenDto): Promise<SwapResponseDto>;
|
|
15
|
-
swapTokenToSol(swapData:
|
|
17
|
+
swapTokenToSol(swapData: SwapTokenToSolDto): Promise<SwapResponseDto>;
|
|
16
18
|
}
|
|
@@ -6,29 +6,33 @@ class ExchangeService {
|
|
|
6
6
|
this.client = client;
|
|
7
7
|
}
|
|
8
8
|
// EVM Exchange
|
|
9
|
-
async
|
|
10
|
-
return this.client.post('/api/v1/evm-exchange/
|
|
9
|
+
async getNativeToTokenPrice(quoteData) {
|
|
10
|
+
return this.client.post('/api/v1/evm-exchange/price/native-to-token', quoteData);
|
|
11
11
|
}
|
|
12
12
|
async swapNativeToToken(swapData) {
|
|
13
13
|
return this.client.post('/api/v1/evm-exchange/native-to-token', swapData);
|
|
14
14
|
}
|
|
15
|
-
async
|
|
16
|
-
return this.client.post('/api/v1/evm-exchange/
|
|
15
|
+
async getTokenToTokenPrice(quoteData) {
|
|
16
|
+
return this.client.post('/api/v1/evm-exchange/price/token-to-token', quoteData);
|
|
17
17
|
}
|
|
18
18
|
async swapTokenToToken(swapData) {
|
|
19
19
|
return this.client.post('/api/v1/evm-exchange/token-to-token', swapData);
|
|
20
20
|
}
|
|
21
|
-
async
|
|
22
|
-
return this.client.post('/api/v1/evm-exchange/
|
|
21
|
+
async getTokenToNativePrice(quoteData) {
|
|
22
|
+
return this.client.post('/api/v1/evm-exchange/price/token-to-native', quoteData);
|
|
23
23
|
}
|
|
24
24
|
async swapTokenToNative(swapData) {
|
|
25
25
|
return this.client.post('/api/v1/evm-exchange/token-to-native', swapData);
|
|
26
26
|
}
|
|
27
27
|
// Solana Exchange
|
|
28
|
-
async
|
|
29
|
-
return this.client.get('/api/v1/solana-exchange/quote', {
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
async getSolanaToTokenQuote(quoteData) {
|
|
29
|
+
return this.client.get('/api/v1/solana-exchange/quote/sol-to-token', { params: quoteData });
|
|
30
|
+
}
|
|
31
|
+
async getTokenToSolanaQuote(quoteData) {
|
|
32
|
+
return this.client.get('/api/v1/solana-exchange/quote/token-to-sol', { params: quoteData });
|
|
33
|
+
}
|
|
34
|
+
async getTokenToTokenQuote(quoteData) {
|
|
35
|
+
return this.client.get('/api/v1/solana-exchange/quote/token-to-token', { params: quoteData });
|
|
32
36
|
}
|
|
33
37
|
async swapSolToToken(swapData) {
|
|
34
38
|
return this.client.post('/api/v1/solana-exchange/swap-sol-to-token', swapData);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MoneiClient } from "../client/MoneiClient";
|
|
2
|
+
import { ResponseDto } from "../types";
|
|
3
|
+
import { PaymentMethodDto, PaymentMethodResponseDto, PaymentMethodsResponseDto } from "../types/payment-method";
|
|
4
|
+
export declare class PaymentMethodService {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: MoneiClient);
|
|
7
|
+
getUserPaymentMethods(subWalletId: string): Promise<PaymentMethodsResponseDto>;
|
|
8
|
+
createPaymentMethod(paymentMethodData: PaymentMethodDto): Promise<PaymentMethodResponseDto>;
|
|
9
|
+
getPaymentMethodDetails(id: string): Promise<PaymentMethodResponseDto>;
|
|
10
|
+
deleteUserPaymentMethods(id: string): Promise<ResponseDto>;
|
|
11
|
+
setDefaultPaymentMethod(id: string): Promise<PaymentMethodResponseDto>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentMethodService = void 0;
|
|
4
|
+
class PaymentMethodService {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async getUserPaymentMethods(subWalletId) {
|
|
9
|
+
return this.client.get('/api/v1/payment-methods', { params: { subWalletId } });
|
|
10
|
+
}
|
|
11
|
+
async createPaymentMethod(paymentMethodData) {
|
|
12
|
+
return this.client.post('/api/v1/payment-methods', paymentMethodData);
|
|
13
|
+
}
|
|
14
|
+
async getPaymentMethodDetails(id) {
|
|
15
|
+
return this.client.get(`/api/v1/payment-methods/${id}`);
|
|
16
|
+
}
|
|
17
|
+
async deleteUserPaymentMethods(id) {
|
|
18
|
+
return this.client.delete(`/api/v1/payment-methods/${id}`);
|
|
19
|
+
}
|
|
20
|
+
async setDefaultPaymentMethod(id) {
|
|
21
|
+
return this.client.patch(`/api/v1/payment-methods/${id}/default`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.PaymentMethodService = PaymentMethodService;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { MoneiClient } from '../client/MoneiClient';
|
|
2
|
-
import {
|
|
2
|
+
import { FundWalletByNairaDto, FundWalletByNairaResponseDto, BankListResponseDto, VerifyBankAccountRequestDto, BankAccountResponseDto, WithdrawWalletDto, PeerTransferDto, VerifyBvnDto, UserKycInfoDto } from '../types';
|
|
3
3
|
export declare class WalletService {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: MoneiClient);
|
|
6
|
-
getWalletBalance(chainId?: number): Promise<UserWalletDto>;
|
|
7
|
-
getNativeBalance(chainId: number): Promise<BalanceResponseDto>;
|
|
8
|
-
getTokenBalance(tokenAddress: string, chainId: number): Promise<BalanceResponseDto>;
|
|
9
6
|
fundWalletByNaira(fundData: FundWalletByNairaDto): Promise<FundWalletByNairaResponseDto>;
|
|
10
7
|
getBanks(): Promise<BankListResponseDto>;
|
|
11
8
|
verifyBankAccount(verifyData: VerifyBankAccountRequestDto): Promise<BankAccountResponseDto>;
|
|
@@ -5,20 +5,6 @@ class WalletService {
|
|
|
5
5
|
constructor(client) {
|
|
6
6
|
this.client = client;
|
|
7
7
|
}
|
|
8
|
-
async getWalletBalance(chainId) {
|
|
9
|
-
const params = chainId ? { chainId } : undefined;
|
|
10
|
-
return this.client.get('/api/v1/wallet/me', { params });
|
|
11
|
-
}
|
|
12
|
-
async getNativeBalance(chainId) {
|
|
13
|
-
return this.client.get('/api/v1/evm/balance/native', {
|
|
14
|
-
params: { chainId }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
async getTokenBalance(tokenAddress, chainId) {
|
|
18
|
-
return this.client.get('/api/v1/evm/balance/token', {
|
|
19
|
-
params: { tokenAddress, chainId }
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
8
|
async fundWalletByNaira(fundData) {
|
|
23
9
|
return this.client.post('/api/v1/wallet/user/fund-wallet', fundData);
|
|
24
10
|
}
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { UserService } from './UserService';
|
|
2
2
|
export { WalletService } from './WalletService';
|
|
3
|
+
export { WalletAccountService, DepositService, PayoutService, WalletUtilityService } from './wallet';
|
|
4
|
+
export { PaymentMethodService } from './PaymentMethodService';
|
|
3
5
|
export { EvmService } from './EvmService';
|
|
4
6
|
export { SolanaService } from './SolanaService';
|
|
5
7
|
export { TransactionService } from './TransactionService';
|
package/dist/services/index.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExchangeService = exports.BillService = exports.AgentService = exports.TransactionService = exports.SolanaService = exports.EvmService = exports.WalletService = exports.UserService = void 0;
|
|
3
|
+
exports.ExchangeService = exports.BillService = exports.AgentService = exports.TransactionService = exports.SolanaService = exports.EvmService = exports.PaymentMethodService = exports.WalletUtilityService = exports.PayoutService = exports.DepositService = exports.WalletAccountService = exports.WalletService = exports.UserService = void 0;
|
|
4
4
|
var UserService_1 = require("./UserService");
|
|
5
5
|
Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return UserService_1.UserService; } });
|
|
6
6
|
var WalletService_1 = require("./WalletService");
|
|
7
7
|
Object.defineProperty(exports, "WalletService", { enumerable: true, get: function () { return WalletService_1.WalletService; } });
|
|
8
|
+
var wallet_1 = require("./wallet");
|
|
9
|
+
Object.defineProperty(exports, "WalletAccountService", { enumerable: true, get: function () { return wallet_1.WalletAccountService; } });
|
|
10
|
+
Object.defineProperty(exports, "DepositService", { enumerable: true, get: function () { return wallet_1.DepositService; } });
|
|
11
|
+
Object.defineProperty(exports, "PayoutService", { enumerable: true, get: function () { return wallet_1.PayoutService; } });
|
|
12
|
+
Object.defineProperty(exports, "WalletUtilityService", { enumerable: true, get: function () { return wallet_1.WalletUtilityService; } });
|
|
13
|
+
var PaymentMethodService_1 = require("./PaymentMethodService");
|
|
14
|
+
Object.defineProperty(exports, "PaymentMethodService", { enumerable: true, get: function () { return PaymentMethodService_1.PaymentMethodService; } });
|
|
8
15
|
var EvmService_1 = require("./EvmService");
|
|
9
16
|
Object.defineProperty(exports, "EvmService", { enumerable: true, get: function () { return EvmService_1.EvmService; } });
|
|
10
17
|
var SolanaService_1 = require("./SolanaService");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MoneiClient } from '../../client/MoneiClient';
|
|
2
|
+
import { CreateVirtualAccountDataDto, UserWalletResponseDto, VirtualAccountResponseDto } from '../../types';
|
|
3
|
+
export declare class WalletAccountService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: MoneiClient);
|
|
6
|
+
getWallet(chainId?: number): Promise<UserWalletResponseDto>;
|
|
7
|
+
createVirtualAccount(accountData: CreateVirtualAccountDataDto): Promise<VirtualAccountResponseDto>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalletAccountService = void 0;
|
|
4
|
+
class WalletAccountService {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async getWallet(chainId) {
|
|
9
|
+
//const params = chainId ? { chainId } : undefined;
|
|
10
|
+
return this.client.get('/api/v1/wallet/me', { params: { chainId } });
|
|
11
|
+
}
|
|
12
|
+
async createVirtualAccount(accountData) {
|
|
13
|
+
return this.client.post('/api/v1/wallet/virtual-account', accountData);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.WalletAccountService = WalletAccountService;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MoneiClient } from '../../client/MoneiClient';
|
|
2
|
+
import { BankAccountResponseDto, BankListResponseDto, VerifyBankAccountRequestDto } from '../../types';
|
|
3
|
+
export declare class WalletUtilityService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: MoneiClient);
|
|
6
|
+
getBanks(): Promise<BankListResponseDto>;
|
|
7
|
+
verifyBankAccount(verifyData: VerifyBankAccountRequestDto): Promise<BankAccountResponseDto>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalletUtilityService = void 0;
|
|
4
|
+
class WalletUtilityService {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async getBanks() {
|
|
9
|
+
return this.client.get('/api/v1/wallet/utils/banks');
|
|
10
|
+
}
|
|
11
|
+
async verifyBankAccount(verifyData) {
|
|
12
|
+
return this.client.post('/api/v1/wallet/utils/verify-bank-account', verifyData);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.WalletUtilityService = WalletUtilityService;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MoneiClient } from '../../client/MoneiClient';
|
|
2
|
+
import { DEPOSIT_METHOD } from '../../types/enums/deposit.enum';
|
|
3
|
+
import { ResponseDto } from '../../types';
|
|
4
|
+
import { CreatePaymentLinkDto, DepositAuthorizationDto, DepositResponseDto, DepositWithPaymentMethodDto, InitializeDepositDto, PaymentLinkResponseDto } from '../../types/deposit';
|
|
5
|
+
export declare class DepositService {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(client: MoneiClient);
|
|
8
|
+
initializeDeposit(method: DEPOSIT_METHOD, depositData: InitializeDepositDto): Promise<DepositResponseDto>;
|
|
9
|
+
depositWithPaymentMethod(depositData: DepositWithPaymentMethodDto): Promise<DepositResponseDto>;
|
|
10
|
+
authorizeDeposit(authorizeData: DepositAuthorizationDto): Promise<ResponseDto>;
|
|
11
|
+
generatePaymentLink(paymentData: CreatePaymentLinkDto): Promise<PaymentLinkResponseDto>;
|
|
12
|
+
getStatus(reference: string): Promise<ResponseDto>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DepositService = void 0;
|
|
4
|
+
class DepositService {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async initializeDeposit(method, depositData) {
|
|
9
|
+
const { data } = await this.client.post('/api/v1/wallet/deposit', depositData, { params: { method }, });
|
|
10
|
+
return data;
|
|
11
|
+
}
|
|
12
|
+
async depositWithPaymentMethod(depositData) {
|
|
13
|
+
return this.client.post('/api/v1/wallet/deposit/payment-method', depositData);
|
|
14
|
+
}
|
|
15
|
+
async authorizeDeposit(authorizeData) {
|
|
16
|
+
return this.client.post('/api/v1/wallet/deposit/authorize', authorizeData);
|
|
17
|
+
}
|
|
18
|
+
async generatePaymentLink(paymentData) {
|
|
19
|
+
return this.client.post('/api/v1/wallet/deposit/payment-link', paymentData);
|
|
20
|
+
}
|
|
21
|
+
async getStatus(reference) {
|
|
22
|
+
return this.client.get(`/api/v1/wallet/deposit/status/${reference}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.DepositService = DepositService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./WalletAccount.service"), exports);
|
|
18
|
+
__exportStar(require("./deposit.service"), exports);
|
|
19
|
+
__exportStar(require("./payout.service"), exports);
|
|
20
|
+
__exportStar(require("./WalletUtility.service"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MoneiClient } from '../../client/MoneiClient';
|
|
2
|
+
import { ResponseDto } from '../../types';
|
|
3
|
+
import { BankTransferRequestDto, BankTransferResponseDto, PeerTransferDto } from '../../types/payout';
|
|
4
|
+
export declare class PayoutService {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: MoneiClient);
|
|
7
|
+
bankTransfer(data: BankTransferRequestDto): Promise<BankTransferResponseDto>;
|
|
8
|
+
peerTransfer(transferData: PeerTransferDto): Promise<ResponseDto>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayoutService = void 0;
|
|
4
|
+
class PayoutService {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async bankTransfer(data) {
|
|
9
|
+
return this.client.post(`/api/v1/wallet/payout/bank-transfer`, data);
|
|
10
|
+
}
|
|
11
|
+
async peerTransfer(transferData) {
|
|
12
|
+
return this.client.post('/api/v1/wallet/payout/transfer', transferData);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.PayoutService = PayoutService;
|
package/dist/types/agent.d.ts
CHANGED
|
@@ -15,6 +15,22 @@ export interface ConversationMessagesResponseDto {
|
|
|
15
15
|
export interface CreateConversationDto {
|
|
16
16
|
id: string;
|
|
17
17
|
}
|
|
18
|
+
export interface initializeConversationDto {
|
|
19
|
+
statusCode: number;
|
|
20
|
+
message: string;
|
|
21
|
+
data: ConversationDto;
|
|
22
|
+
}
|
|
23
|
+
export interface ConversationDto {
|
|
24
|
+
id: string;
|
|
25
|
+
user?: {};
|
|
26
|
+
messages?: {};
|
|
27
|
+
title: string;
|
|
28
|
+
context?: string;
|
|
29
|
+
isPinned: boolean;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
deletedDate?: string;
|
|
33
|
+
}
|
|
18
34
|
export interface PinConversationDto {
|
|
19
35
|
pin: boolean;
|
|
20
36
|
}
|
package/dist/types/bills.d.ts
CHANGED
|
@@ -28,8 +28,19 @@ export interface BillerItemsResponseDto {
|
|
|
28
28
|
message: string;
|
|
29
29
|
data: BillerDto[];
|
|
30
30
|
}
|
|
31
|
+
export interface ElectricityBillerDto {
|
|
32
|
+
name: string;
|
|
33
|
+
code: string;
|
|
34
|
+
billerCode: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ElectricityBillerResponseDto {
|
|
37
|
+
statusCode: number;
|
|
38
|
+
message: string;
|
|
39
|
+
data: ElectricityBillerDto[];
|
|
40
|
+
}
|
|
31
41
|
export interface ValidateBillDto {
|
|
32
|
-
itemCode
|
|
42
|
+
itemCode?: string;
|
|
43
|
+
billerCode: string;
|
|
33
44
|
customer: string;
|
|
34
45
|
}
|
|
35
46
|
export interface CreateBillScheduleDto {
|
|
@@ -116,3 +127,32 @@ export interface BillDto {
|
|
|
116
127
|
token?: string;
|
|
117
128
|
units?: string;
|
|
118
129
|
}
|
|
130
|
+
export interface BillResponseDto {
|
|
131
|
+
statusCode: 200;
|
|
132
|
+
message: string;
|
|
133
|
+
data: BillDto;
|
|
134
|
+
}
|
|
135
|
+
export interface PaginatedBillDto {
|
|
136
|
+
bills: BillDto[];
|
|
137
|
+
page: number;
|
|
138
|
+
total: number;
|
|
139
|
+
totalPages: number;
|
|
140
|
+
hasNext: boolean;
|
|
141
|
+
hasPrev: boolean;
|
|
142
|
+
}
|
|
143
|
+
export interface PaginatedBillResponseDto {
|
|
144
|
+
statusCode: number;
|
|
145
|
+
message: string;
|
|
146
|
+
data: PaginatedBillDto;
|
|
147
|
+
}
|
|
148
|
+
export interface BillDataDto {
|
|
149
|
+
type: false;
|
|
150
|
+
status: string;
|
|
151
|
+
billerName: string;
|
|
152
|
+
billerCode: string;
|
|
153
|
+
customer: string;
|
|
154
|
+
startDate: string;
|
|
155
|
+
endDate: string;
|
|
156
|
+
amount: number;
|
|
157
|
+
reference: string;
|
|
158
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AuthAction, AuthType } from "./enums/deposit.enum";
|
|
2
|
+
import { TransactionStatus } from "./enums/transaction.enum";
|
|
3
|
+
import { CardDto, UssdDto } from "./wallet";
|
|
4
|
+
export interface CreatePaymentLinkDto {
|
|
5
|
+
amount: number;
|
|
6
|
+
reference?: string;
|
|
7
|
+
currency?: string;
|
|
8
|
+
redirectUrl?: string;
|
|
9
|
+
customization?: Customization;
|
|
10
|
+
customer?: Customer;
|
|
11
|
+
}
|
|
12
|
+
interface Customization {
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
interface Customer {
|
|
16
|
+
email: string;
|
|
17
|
+
phoneNumber: string;
|
|
18
|
+
name: string;
|
|
19
|
+
}
|
|
20
|
+
interface NextAction {
|
|
21
|
+
type: AuthAction;
|
|
22
|
+
redirect_url?: {
|
|
23
|
+
url: string;
|
|
24
|
+
};
|
|
25
|
+
payment_instruction?: {
|
|
26
|
+
note: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface InitializeDepositDto {
|
|
30
|
+
amount: number;
|
|
31
|
+
reference?: string;
|
|
32
|
+
currency?: 'NGN';
|
|
33
|
+
narration?: string;
|
|
34
|
+
card?: CardDto;
|
|
35
|
+
ussd?: UssdDto;
|
|
36
|
+
}
|
|
37
|
+
export interface DepositResponseDataDto {
|
|
38
|
+
amount: number;
|
|
39
|
+
reference: string;
|
|
40
|
+
currency: string;
|
|
41
|
+
redirectUrl?: string;
|
|
42
|
+
customization?: Customization;
|
|
43
|
+
customer?: Customer;
|
|
44
|
+
narration: string;
|
|
45
|
+
accountNumber?: string;
|
|
46
|
+
bankName?: string;
|
|
47
|
+
accountName?: string;
|
|
48
|
+
expiry_datetime?: string;
|
|
49
|
+
note?: string;
|
|
50
|
+
status: TransactionStatus;
|
|
51
|
+
nextAction?: NextAction;
|
|
52
|
+
}
|
|
53
|
+
export interface DepositResponseDto {
|
|
54
|
+
statusCode: number;
|
|
55
|
+
message: string;
|
|
56
|
+
data: DepositResponseDataDto;
|
|
57
|
+
errors?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface PaymentLinkResponseDto {
|
|
60
|
+
statusCode: number;
|
|
61
|
+
message: string;
|
|
62
|
+
data: LinkDto;
|
|
63
|
+
errors?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface DepositWithPaymentMethodDto {
|
|
66
|
+
amount: number;
|
|
67
|
+
paymentMethodId: string;
|
|
68
|
+
reference: string;
|
|
69
|
+
currency: 'NGN';
|
|
70
|
+
redirectUrl: string;
|
|
71
|
+
meta: Record<string, any>;
|
|
72
|
+
narration: string;
|
|
73
|
+
}
|
|
74
|
+
export interface PaymentResponseDto {
|
|
75
|
+
statusCode: number;
|
|
76
|
+
message: string;
|
|
77
|
+
data: LinkDto;
|
|
78
|
+
errors?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface LinkDto {
|
|
81
|
+
link: string;
|
|
82
|
+
}
|
|
83
|
+
export interface DepositAuthorizationDto {
|
|
84
|
+
type: AuthType;
|
|
85
|
+
reference: string;
|
|
86
|
+
pin: string;
|
|
87
|
+
otp: string;
|
|
88
|
+
avs: AvsDto;
|
|
89
|
+
}
|
|
90
|
+
export interface AvsDto {
|
|
91
|
+
address: AvsAddressDto;
|
|
92
|
+
}
|
|
93
|
+
export interface AvsAddressDto {
|
|
94
|
+
city: string;
|
|
95
|
+
country: string;
|
|
96
|
+
line1: string;
|
|
97
|
+
line2: string;
|
|
98
|
+
postal_code: string;
|
|
99
|
+
state: string;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum DEPOSIT_METHOD {
|
|
2
|
+
BANK_TRANSFER = "BANK_TRANSFER",
|
|
3
|
+
USSD = "USSD",
|
|
4
|
+
CARD = "CARD"
|
|
5
|
+
}
|
|
6
|
+
export declare enum AuthAction {
|
|
7
|
+
PIN = "requires_pin",
|
|
8
|
+
OTP = "requires_otp",
|
|
9
|
+
REDIRECT_URL = "redirect_url",
|
|
10
|
+
ADDITIONAL_FIELDS = "requires_additional_fields",
|
|
11
|
+
PAYMENT_INSTRUCTIONS = "payment_Instructions"
|
|
12
|
+
}
|
|
13
|
+
export declare enum AuthType {
|
|
14
|
+
PIN = "pin",
|
|
15
|
+
OTP = "otp",
|
|
16
|
+
AVS = "avs",
|
|
17
|
+
REDIRECT_URL = "redirect_url",
|
|
18
|
+
PAYMENT_INSTRUCTION = "payment_instruction"
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthType = exports.AuthAction = exports.DEPOSIT_METHOD = void 0;
|
|
4
|
+
var DEPOSIT_METHOD;
|
|
5
|
+
(function (DEPOSIT_METHOD) {
|
|
6
|
+
DEPOSIT_METHOD["BANK_TRANSFER"] = "BANK_TRANSFER";
|
|
7
|
+
DEPOSIT_METHOD["USSD"] = "USSD";
|
|
8
|
+
DEPOSIT_METHOD["CARD"] = "CARD";
|
|
9
|
+
})(DEPOSIT_METHOD || (exports.DEPOSIT_METHOD = DEPOSIT_METHOD = {}));
|
|
10
|
+
var AuthAction;
|
|
11
|
+
(function (AuthAction) {
|
|
12
|
+
AuthAction["PIN"] = "requires_pin";
|
|
13
|
+
AuthAction["OTP"] = "requires_otp";
|
|
14
|
+
AuthAction["REDIRECT_URL"] = "redirect_url";
|
|
15
|
+
AuthAction["ADDITIONAL_FIELDS"] = "requires_additional_fields";
|
|
16
|
+
AuthAction["PAYMENT_INSTRUCTIONS"] = "payment_Instructions";
|
|
17
|
+
})(AuthAction || (exports.AuthAction = AuthAction = {}));
|
|
18
|
+
var AuthType;
|
|
19
|
+
(function (AuthType) {
|
|
20
|
+
AuthType["PIN"] = "pin";
|
|
21
|
+
AuthType["OTP"] = "otp";
|
|
22
|
+
AuthType["AVS"] = "avs";
|
|
23
|
+
AuthType["REDIRECT_URL"] = "redirect_url";
|
|
24
|
+
AuthType["PAYMENT_INSTRUCTION"] = "payment_instruction";
|
|
25
|
+
})(AuthType || (exports.AuthType = AuthType = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentMethodType = void 0;
|
|
4
|
+
var PaymentMethodType;
|
|
5
|
+
(function (PaymentMethodType) {
|
|
6
|
+
PaymentMethodType["VIRTUAL_ACCOUNT"] = "VIRTUAL_ACCOUNT";
|
|
7
|
+
PaymentMethodType["CARD"] = "CARD";
|
|
8
|
+
PaymentMethodType["BANK_TRANSFER"] = "BANK_TRANSFER";
|
|
9
|
+
PaymentMethodType["USSD"] = "USSD";
|
|
10
|
+
PaymentMethodType["CRYPTO_WALLET"] = "CRYPTO_WALLET";
|
|
11
|
+
})(PaymentMethodType || (exports.PaymentMethodType = PaymentMethodType = {}));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare enum TransactionType {
|
|
2
|
+
DEBIT = "DEBIT",
|
|
3
|
+
CREDIT = "CREDIT",
|
|
4
|
+
PEER_TRANSFER = "PEER-TRANSFER"
|
|
5
|
+
}
|
|
6
|
+
export declare enum TransactionStatus {
|
|
7
|
+
PENDING = "PENDING",
|
|
8
|
+
SUCCESS = "SUCCESS",
|
|
9
|
+
FAILED = "FAILED",
|
|
10
|
+
COMPLETED = "COMPLETED"
|
|
11
|
+
}
|
|
12
|
+
export declare enum TransactionOwnerType {
|
|
13
|
+
USER = "USER",
|
|
14
|
+
BUSINESS_CUSTOMER = "BUSINESS_CUSTOMER"
|
|
15
|
+
}
|
|
16
|
+
export declare enum TransactionNature {
|
|
17
|
+
FIAT_DEPOSIT = "FIAT_DEPOSIT",
|
|
18
|
+
FIAT_CARD_DEPOSIT = "FIAT_CARD_DEPOSIT",
|
|
19
|
+
FIAT_USSD_DEPOSIT = "FIAT_USSD_DEPOSIT",
|
|
20
|
+
FIAT_WITHDRAWAL = "FIAT_WITHDRAWAL",
|
|
21
|
+
FIAT_TRANSFER = "FIAT_TRANSFER",
|
|
22
|
+
FIAT_P2P = "FIAT_P2P",
|
|
23
|
+
CRYPTO_DEPOSIT = "CRYPTO_DEPOSIT",
|
|
24
|
+
CRYPTO_WITHDRAWAL = "CRYPTO_WITHDRAWAL",
|
|
25
|
+
CRYPTO_TRADE_BUY = "CRYPTO_TRADE_BUY",
|
|
26
|
+
CRYPTO_TRADE_SELL = "CRYPTO_TRADE_SELL",
|
|
27
|
+
CRYPTO_P2P = "CRYPTO_P2P",
|
|
28
|
+
CROSS_BORDER_IN = "CROSS_BORDER_IN",
|
|
29
|
+
CROSS_BORDER_OUT = "CROSS_BORDER_OUT",
|
|
30
|
+
FOREX_BUY = "FOREX_BUY",
|
|
31
|
+
FOREX_SELL = "FOREX_SELL",
|
|
32
|
+
BUY_TOKENIZED_STOCK = "BUY_TOKENIZED_STOCK",
|
|
33
|
+
SELL_TOKENIZED_STOCK = "SELL_TOKENIZED_STOCK"
|
|
34
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionNature = exports.TransactionOwnerType = exports.TransactionStatus = exports.TransactionType = void 0;
|
|
4
|
+
var TransactionType;
|
|
5
|
+
(function (TransactionType) {
|
|
6
|
+
TransactionType["DEBIT"] = "DEBIT";
|
|
7
|
+
TransactionType["CREDIT"] = "CREDIT";
|
|
8
|
+
TransactionType["PEER_TRANSFER"] = "PEER-TRANSFER";
|
|
9
|
+
})(TransactionType || (exports.TransactionType = TransactionType = {}));
|
|
10
|
+
var TransactionStatus;
|
|
11
|
+
(function (TransactionStatus) {
|
|
12
|
+
TransactionStatus["PENDING"] = "PENDING";
|
|
13
|
+
TransactionStatus["SUCCESS"] = "SUCCESS";
|
|
14
|
+
TransactionStatus["FAILED"] = "FAILED";
|
|
15
|
+
TransactionStatus["COMPLETED"] = "COMPLETED";
|
|
16
|
+
})(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
|
|
17
|
+
var TransactionOwnerType;
|
|
18
|
+
(function (TransactionOwnerType) {
|
|
19
|
+
TransactionOwnerType["USER"] = "USER";
|
|
20
|
+
TransactionOwnerType["BUSINESS_CUSTOMER"] = "BUSINESS_CUSTOMER";
|
|
21
|
+
})(TransactionOwnerType || (exports.TransactionOwnerType = TransactionOwnerType = {}));
|
|
22
|
+
var TransactionNature;
|
|
23
|
+
(function (TransactionNature) {
|
|
24
|
+
TransactionNature["FIAT_DEPOSIT"] = "FIAT_DEPOSIT";
|
|
25
|
+
TransactionNature["FIAT_CARD_DEPOSIT"] = "FIAT_CARD_DEPOSIT";
|
|
26
|
+
TransactionNature["FIAT_USSD_DEPOSIT"] = "FIAT_USSD_DEPOSIT";
|
|
27
|
+
TransactionNature["FIAT_WITHDRAWAL"] = "FIAT_WITHDRAWAL";
|
|
28
|
+
TransactionNature["FIAT_TRANSFER"] = "FIAT_TRANSFER";
|
|
29
|
+
TransactionNature["FIAT_P2P"] = "FIAT_P2P";
|
|
30
|
+
TransactionNature["CRYPTO_DEPOSIT"] = "CRYPTO_DEPOSIT";
|
|
31
|
+
TransactionNature["CRYPTO_WITHDRAWAL"] = "CRYPTO_WITHDRAWAL";
|
|
32
|
+
TransactionNature["CRYPTO_TRADE_BUY"] = "CRYPTO_TRADE_BUY";
|
|
33
|
+
TransactionNature["CRYPTO_TRADE_SELL"] = "CRYPTO_TRADE_SELL";
|
|
34
|
+
TransactionNature["CRYPTO_P2P"] = "CRYPTO_P2P";
|
|
35
|
+
TransactionNature["CROSS_BORDER_IN"] = "CROSS_BORDER_IN";
|
|
36
|
+
TransactionNature["CROSS_BORDER_OUT"] = "CROSS_BORDER_OUT";
|
|
37
|
+
TransactionNature["FOREX_BUY"] = "FOREX_BUY";
|
|
38
|
+
TransactionNature["FOREX_SELL"] = "FOREX_SELL";
|
|
39
|
+
TransactionNature["BUY_TOKENIZED_STOCK"] = "BUY_TOKENIZED_STOCK";
|
|
40
|
+
TransactionNature["SELL_TOKENIZED_STOCK"] = "SELL_TOKENIZED_STOCK";
|
|
41
|
+
})(TransactionNature || (exports.TransactionNature = TransactionNature = {}));
|
package/dist/types/evm.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
export interface SupportedNetworkDto {
|
|
2
|
+
chainId: number;
|
|
3
|
+
name: string;
|
|
4
|
+
nativeToken: string;
|
|
5
|
+
blockExploreUrl: string;
|
|
6
|
+
isTestnet: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SupportedNetworkResponseDto {
|
|
9
|
+
statusCode: number;
|
|
10
|
+
message: string;
|
|
11
|
+
data: SupportedNetworkDto[];
|
|
12
|
+
}
|
|
1
13
|
export interface UserTokenBalanceDto {
|
|
2
14
|
contractAddress: string;
|
|
3
15
|
name: string;
|
package/dist/types/exchange.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface ZeroExQuoteDto {
|
|
|
18
18
|
permit2?: any;
|
|
19
19
|
transaction: any;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface PriceResponseDto {
|
|
22
22
|
statusCode: number;
|
|
23
23
|
message: string;
|
|
24
24
|
data: ZeroExQuoteDto;
|
|
@@ -36,6 +36,10 @@ export interface SwapSolToTokenDto {
|
|
|
36
36
|
amount: number;
|
|
37
37
|
slippageBps?: number;
|
|
38
38
|
}
|
|
39
|
+
export interface SwapTokenToSolDto {
|
|
40
|
+
amount: string;
|
|
41
|
+
inputMint: string;
|
|
42
|
+
}
|
|
39
43
|
export interface SwapDto {
|
|
40
44
|
signature: string;
|
|
41
45
|
txUrl: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PaymentMethodType } from "./enums/payment-method";
|
|
2
|
+
import { CardDto, UssdDto } from "./wallet";
|
|
3
|
+
export interface PaymentMethodDto {
|
|
4
|
+
type: PaymentMethodType;
|
|
5
|
+
nickname?: string;
|
|
6
|
+
subWalletId: string;
|
|
7
|
+
card?: CardDto;
|
|
8
|
+
virtualAccountId?: string;
|
|
9
|
+
ussd?: UssdDto;
|
|
10
|
+
}
|
|
11
|
+
export interface PaymentMethodResponseDto {
|
|
12
|
+
statusCode: number;
|
|
13
|
+
message: string;
|
|
14
|
+
data: PaymentMethodDetailsDto;
|
|
15
|
+
}
|
|
16
|
+
export interface PaymentMethodsResponseDto {
|
|
17
|
+
statusCode: number;
|
|
18
|
+
message: string;
|
|
19
|
+
data: PaymentMethodDetailsDto[];
|
|
20
|
+
}
|
|
21
|
+
export interface PaymentMethodDetailsDto {
|
|
22
|
+
id: string;
|
|
23
|
+
type: PaymentMethodType;
|
|
24
|
+
status: string;
|
|
25
|
+
isDefault: boolean;
|
|
26
|
+
nickname?: string;
|
|
27
|
+
isEnabled: boolean;
|
|
28
|
+
lastUsedAt: string | null;
|
|
29
|
+
usageCount: number;
|
|
30
|
+
capability: {};
|
|
31
|
+
details: {};
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TransactionStatus } from "./enums/transaction.enum";
|
|
2
|
+
export interface BankTransferRequestDto {
|
|
3
|
+
amount: number;
|
|
4
|
+
bank: string;
|
|
5
|
+
accountNumber: string;
|
|
6
|
+
transactionPin: string;
|
|
7
|
+
reference?: string;
|
|
8
|
+
narration?: string;
|
|
9
|
+
meta?: any;
|
|
10
|
+
}
|
|
11
|
+
export interface BankTransferResponseDataDto {
|
|
12
|
+
reference: string;
|
|
13
|
+
status: TransactionStatus;
|
|
14
|
+
amount: number;
|
|
15
|
+
}
|
|
16
|
+
export interface BankTransferResponseDto {
|
|
17
|
+
statusCode: string;
|
|
18
|
+
message: string;
|
|
19
|
+
data: BankTransferResponseDataDto;
|
|
20
|
+
errors?: any;
|
|
21
|
+
}
|
|
22
|
+
export interface PeerTransferDto {
|
|
23
|
+
receiver: string;
|
|
24
|
+
amount: number;
|
|
25
|
+
transactionPin: string;
|
|
26
|
+
currency?: string;
|
|
27
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1,35 +1,48 @@
|
|
|
1
|
+
import { TransactionNature, TransactionStatus, TransactionType } from "./enums/transaction.enum";
|
|
1
2
|
export interface TransactionResponseDto {
|
|
2
3
|
id: string;
|
|
3
|
-
createdAt: string;
|
|
4
|
-
updatedAt: string;
|
|
5
|
-
deletedDate: string;
|
|
6
4
|
userId: string;
|
|
7
5
|
amount: number;
|
|
8
|
-
type:
|
|
9
|
-
status:
|
|
6
|
+
type: TransactionType;
|
|
7
|
+
status: TransactionStatus;
|
|
10
8
|
reference: string;
|
|
11
9
|
currency: string;
|
|
12
10
|
narration: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
deletedDate: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface UserTransactionsDataDto {
|
|
16
|
+
transactions: TransactionResponseDto[];
|
|
17
|
+
pagination: PaginationDto;
|
|
13
18
|
}
|
|
14
19
|
export interface UserTransactionsResponseDto {
|
|
15
20
|
statusCode: number;
|
|
16
21
|
message: string;
|
|
17
|
-
data:
|
|
22
|
+
data: UserTransactionsDataDto;
|
|
18
23
|
}
|
|
19
24
|
export interface TransactionDto {
|
|
20
25
|
id: string;
|
|
21
|
-
createdAt: string;
|
|
22
|
-
updatedAt: string;
|
|
23
|
-
deletedDate: string;
|
|
24
|
-
user: any;
|
|
25
|
-
wallet: any;
|
|
26
|
-
subwallet: any;
|
|
27
26
|
amount: number;
|
|
28
|
-
type:
|
|
29
|
-
status:
|
|
30
|
-
currency
|
|
27
|
+
type: TransactionType;
|
|
28
|
+
status: TransactionStatus;
|
|
29
|
+
currency?: string;
|
|
31
30
|
reference: string;
|
|
32
|
-
fincraReference?: string;
|
|
33
31
|
narration: string;
|
|
32
|
+
nature: TransactionNature;
|
|
33
|
+
user: any;
|
|
34
|
+
wallet: any;
|
|
35
|
+
subwallet?: any;
|
|
34
36
|
metadata?: any;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
deletedDate: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface PaginationDto {
|
|
42
|
+
page: number;
|
|
43
|
+
limit: number;
|
|
44
|
+
total: number;
|
|
45
|
+
totalPages: number;
|
|
46
|
+
hasNextPage: boolean;
|
|
47
|
+
hasPreviousPage: boolean;
|
|
35
48
|
}
|
package/dist/types/wallet.d.ts
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
export declare enum DepositMethodsEnum {
|
|
2
|
+
BANK_TRANSFER = "BANK_TRANSFER",
|
|
3
|
+
USSD = "USSD",
|
|
4
|
+
VirtualId = "VirtualId"
|
|
5
|
+
}
|
|
6
|
+
export interface WalletDepositResponseDto {
|
|
7
|
+
statusCode: string;
|
|
8
|
+
message: string;
|
|
9
|
+
data: WalletDepositDto;
|
|
10
|
+
}
|
|
11
|
+
export interface WalletDepositDto {
|
|
12
|
+
amount: string;
|
|
13
|
+
reference: string;
|
|
14
|
+
currency: 'NGN';
|
|
15
|
+
narration: string;
|
|
16
|
+
status: string;
|
|
17
|
+
nextAction: {};
|
|
18
|
+
}
|
|
19
|
+
export interface ResponseDto {
|
|
20
|
+
statusCode: number;
|
|
21
|
+
message: string;
|
|
22
|
+
data: any;
|
|
23
|
+
error?: any;
|
|
24
|
+
}
|
|
25
|
+
export interface CardDto {
|
|
26
|
+
expiryMonth: string;
|
|
27
|
+
expiryYear: string;
|
|
28
|
+
cardNumber: string;
|
|
29
|
+
cvv: string;
|
|
30
|
+
cardHolderName: string;
|
|
31
|
+
}
|
|
32
|
+
export interface UssdDto {
|
|
33
|
+
bankCode: string;
|
|
34
|
+
}
|
|
1
35
|
export interface BalanceDto {
|
|
2
36
|
balance: string;
|
|
3
37
|
}
|
|
@@ -50,16 +84,15 @@ export interface UserWalletDto {
|
|
|
50
84
|
solPortfolio?: any;
|
|
51
85
|
subwallets: SubWalletDto[];
|
|
52
86
|
}
|
|
87
|
+
export interface UserWalletResponseDto {
|
|
88
|
+
statusCode: number;
|
|
89
|
+
message: string;
|
|
90
|
+
data: UserWalletDto;
|
|
91
|
+
}
|
|
53
92
|
export interface BankDto {
|
|
54
|
-
swiftCode?: string;
|
|
55
|
-
bic?: string;
|
|
56
|
-
isMobileVerified?: boolean;
|
|
57
|
-
isCashPickUp: boolean;
|
|
58
|
-
nibssCode: string;
|
|
59
93
|
id: string;
|
|
60
94
|
code: string;
|
|
61
95
|
name: string;
|
|
62
|
-
branches: any[];
|
|
63
96
|
}
|
|
64
97
|
export interface BankListResponseDto {
|
|
65
98
|
statusCode: number;
|
|
@@ -126,4 +159,105 @@ export interface WalletResponseDto {
|
|
|
126
159
|
message: string;
|
|
127
160
|
data: WithdrawDto;
|
|
128
161
|
}
|
|
162
|
+
export interface WalletOverviewDto {
|
|
163
|
+
nairaBalance: string;
|
|
164
|
+
subwallets: SubwalletDto[];
|
|
165
|
+
}
|
|
166
|
+
export interface SubwalletDto {
|
|
167
|
+
id: string;
|
|
168
|
+
type: 'CRYPTO' | 'FIAT';
|
|
169
|
+
virtualAccount: string | null;
|
|
170
|
+
currency: string;
|
|
171
|
+
balance: number;
|
|
172
|
+
chain: 'SOLANA' | 'EVM' | null;
|
|
173
|
+
publicAddress: string | null;
|
|
174
|
+
createdAt: string;
|
|
175
|
+
updatedAt: string;
|
|
176
|
+
deletedDate: string | null;
|
|
177
|
+
solPortfolio?: SolPortfolioDto;
|
|
178
|
+
evmPortfolio?: EvmPortfolioDto;
|
|
179
|
+
}
|
|
180
|
+
export interface SolPortfolioDto {
|
|
181
|
+
userId: string;
|
|
182
|
+
address: string;
|
|
183
|
+
nativeBalance: string;
|
|
184
|
+
nativeBalanceLamports: string;
|
|
185
|
+
tokens: SolTokenDto[];
|
|
186
|
+
}
|
|
187
|
+
export interface SolTokenDto {
|
|
188
|
+
mintAddress: string;
|
|
189
|
+
name: string;
|
|
190
|
+
symbol: string;
|
|
191
|
+
balance: number;
|
|
192
|
+
rawBalance: string;
|
|
193
|
+
decimals: number;
|
|
194
|
+
}
|
|
195
|
+
export interface EvmPortfolioDto {
|
|
196
|
+
userId: string;
|
|
197
|
+
walletAddress: string;
|
|
198
|
+
network: string;
|
|
199
|
+
totalPortfolioValueUSD: string;
|
|
200
|
+
nativeToken: EvmNativeTokenDto;
|
|
201
|
+
tokens: EvmTokenDto[];
|
|
202
|
+
updatedAt: string;
|
|
203
|
+
}
|
|
204
|
+
export interface EvmNativeTokenDto {
|
|
205
|
+
name: string;
|
|
206
|
+
symbol: string;
|
|
207
|
+
decimals: number;
|
|
208
|
+
logoUrl: string;
|
|
209
|
+
balance: string;
|
|
210
|
+
balanceUSD: string;
|
|
211
|
+
priceUSD: string;
|
|
212
|
+
rawBalance: string;
|
|
213
|
+
network: string;
|
|
214
|
+
type: 'native';
|
|
215
|
+
}
|
|
216
|
+
export interface EvmTokenDto {
|
|
217
|
+
name: string;
|
|
218
|
+
symbol: string;
|
|
219
|
+
decimals: number;
|
|
220
|
+
logoUrl?: string;
|
|
221
|
+
balance: string;
|
|
222
|
+
balanceUSD: string;
|
|
223
|
+
priceUSD: string;
|
|
224
|
+
rawBalance: string;
|
|
225
|
+
contractAddress: string;
|
|
226
|
+
network: string;
|
|
227
|
+
type: 'erc20';
|
|
228
|
+
}
|
|
229
|
+
export interface CreateVirtualAccountDataDto {
|
|
230
|
+
nin: string;
|
|
231
|
+
reference?: string;
|
|
232
|
+
}
|
|
233
|
+
export interface VirtualAccountResponseDto {
|
|
234
|
+
statusCode: number;
|
|
235
|
+
message: string;
|
|
236
|
+
data: VirtualAccountDto;
|
|
237
|
+
}
|
|
238
|
+
export interface VirtualAccountDto {
|
|
239
|
+
id: string;
|
|
240
|
+
createdAt: string;
|
|
241
|
+
updatedAt: string;
|
|
242
|
+
deletedDate: string | null;
|
|
243
|
+
accountNumber: string;
|
|
244
|
+
bankName: string;
|
|
245
|
+
reference: string;
|
|
246
|
+
status: string;
|
|
247
|
+
isActive: boolean;
|
|
248
|
+
}
|
|
249
|
+
export interface virtualSubWalletDto {
|
|
250
|
+
id: string;
|
|
251
|
+
type: 'CRYPTO' | 'FIAT';
|
|
252
|
+
currency: string;
|
|
253
|
+
balance: number;
|
|
254
|
+
chain: 'EVM' | 'SOLANA' | null;
|
|
255
|
+
publicAddress: string | null;
|
|
256
|
+
}
|
|
257
|
+
export interface TransferDto {
|
|
258
|
+
receiver: string;
|
|
259
|
+
amount: number;
|
|
260
|
+
transactionPin: string;
|
|
261
|
+
currency: string;
|
|
262
|
+
}
|
|
129
263
|
export {};
|
package/dist/types/wallet.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DepositMethodsEnum = void 0;
|
|
4
|
+
var DepositMethodsEnum;
|
|
5
|
+
(function (DepositMethodsEnum) {
|
|
6
|
+
DepositMethodsEnum["BANK_TRANSFER"] = "BANK_TRANSFER";
|
|
7
|
+
DepositMethodsEnum["USSD"] = "USSD";
|
|
8
|
+
DepositMethodsEnum["VirtualId"] = "VirtualId";
|
|
9
|
+
})(DepositMethodsEnum || (exports.DepositMethodsEnum = DepositMethodsEnum = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monei-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Node.js SDK for Monei API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"axios": "^1.13.2",
|
|
28
|
+
"dotenv": "^17.2.3",
|
|
28
29
|
"ts-node": "^10.9.2"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|