@morambacrypto/connect 0.0.27 → 0.0.28
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/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -496,6 +496,19 @@ interface PayoutDestinationData {
|
|
|
496
496
|
to_wallet_address: string;
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
+
interface CreatePayinButtonRequestDto {
|
|
500
|
+
name: string;
|
|
501
|
+
email: string;
|
|
502
|
+
payment_method: PaymentMethod;
|
|
503
|
+
to_wallet_address: string;
|
|
504
|
+
amount: string;
|
|
505
|
+
payment_description: string;
|
|
506
|
+
bill_date: number;
|
|
507
|
+
is_public: boolean;
|
|
508
|
+
from_wallet_address?: string;
|
|
509
|
+
client_payment_id: string;
|
|
510
|
+
}
|
|
511
|
+
|
|
499
512
|
declare class PayAPI {
|
|
500
513
|
private http;
|
|
501
514
|
constructor(http: HttpClient);
|
|
@@ -516,6 +529,12 @@ declare class PayoutDestinationAPI {
|
|
|
516
529
|
getPayoutDestination(payload: FindPayoutDestination, jwtToken: string): Promise<PayoutDestinationResponse>;
|
|
517
530
|
}
|
|
518
531
|
|
|
532
|
+
declare class PayinButtonAPI {
|
|
533
|
+
private http;
|
|
534
|
+
constructor(http: HttpClient);
|
|
535
|
+
createPayinButton(payload: CreatePayinButtonRequestDto, jwtToken: string): Promise<PayinUserResponse>;
|
|
536
|
+
}
|
|
537
|
+
|
|
519
538
|
interface MorambaClientConfig {
|
|
520
539
|
baseURL: string;
|
|
521
540
|
apiKey: string;
|
|
@@ -532,6 +551,7 @@ declare class MorambaClient {
|
|
|
532
551
|
pay: PayAPI;
|
|
533
552
|
payoutDestinationMerchant: PayoutDestinationMerchantAPI;
|
|
534
553
|
payoutDestination: PayoutDestinationAPI;
|
|
554
|
+
payinButton: PayinButtonAPI;
|
|
535
555
|
constructor(config: MorambaClientConfig);
|
|
536
556
|
}
|
|
537
557
|
|
|
@@ -557,4 +577,4 @@ declare function sepoliaApprove(options: SepoliaApproveOptions): Promise<{
|
|
|
557
577
|
receipt: any;
|
|
558
578
|
}>;
|
|
559
579
|
|
|
560
|
-
export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestination, type FindPayoutDestinationMerchant, type FindPayoutDestinationUser, type GetAPayoutDestinationMerchant, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationData, type PayoutDestinationMerchantData, type PayoutDestinationMerchantResponse, type PayoutDestinationResponse, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
|
|
580
|
+
export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinButtonRequestDto, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestination, type FindPayoutDestinationMerchant, type FindPayoutDestinationUser, type GetAPayoutDestinationMerchant, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationData, type PayoutDestinationMerchantData, type PayoutDestinationMerchantResponse, type PayoutDestinationResponse, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
|
package/dist/index.d.ts
CHANGED
|
@@ -496,6 +496,19 @@ interface PayoutDestinationData {
|
|
|
496
496
|
to_wallet_address: string;
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
+
interface CreatePayinButtonRequestDto {
|
|
500
|
+
name: string;
|
|
501
|
+
email: string;
|
|
502
|
+
payment_method: PaymentMethod;
|
|
503
|
+
to_wallet_address: string;
|
|
504
|
+
amount: string;
|
|
505
|
+
payment_description: string;
|
|
506
|
+
bill_date: number;
|
|
507
|
+
is_public: boolean;
|
|
508
|
+
from_wallet_address?: string;
|
|
509
|
+
client_payment_id: string;
|
|
510
|
+
}
|
|
511
|
+
|
|
499
512
|
declare class PayAPI {
|
|
500
513
|
private http;
|
|
501
514
|
constructor(http: HttpClient);
|
|
@@ -516,6 +529,12 @@ declare class PayoutDestinationAPI {
|
|
|
516
529
|
getPayoutDestination(payload: FindPayoutDestination, jwtToken: string): Promise<PayoutDestinationResponse>;
|
|
517
530
|
}
|
|
518
531
|
|
|
532
|
+
declare class PayinButtonAPI {
|
|
533
|
+
private http;
|
|
534
|
+
constructor(http: HttpClient);
|
|
535
|
+
createPayinButton(payload: CreatePayinButtonRequestDto, jwtToken: string): Promise<PayinUserResponse>;
|
|
536
|
+
}
|
|
537
|
+
|
|
519
538
|
interface MorambaClientConfig {
|
|
520
539
|
baseURL: string;
|
|
521
540
|
apiKey: string;
|
|
@@ -532,6 +551,7 @@ declare class MorambaClient {
|
|
|
532
551
|
pay: PayAPI;
|
|
533
552
|
payoutDestinationMerchant: PayoutDestinationMerchantAPI;
|
|
534
553
|
payoutDestination: PayoutDestinationAPI;
|
|
554
|
+
payinButton: PayinButtonAPI;
|
|
535
555
|
constructor(config: MorambaClientConfig);
|
|
536
556
|
}
|
|
537
557
|
|
|
@@ -557,4 +577,4 @@ declare function sepoliaApprove(options: SepoliaApproveOptions): Promise<{
|
|
|
557
577
|
receipt: any;
|
|
558
578
|
}>;
|
|
559
579
|
|
|
560
|
-
export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestination, type FindPayoutDestinationMerchant, type FindPayoutDestinationUser, type GetAPayoutDestinationMerchant, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationData, type PayoutDestinationMerchantData, type PayoutDestinationMerchantResponse, type PayoutDestinationResponse, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
|
|
580
|
+
export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinButtonRequestDto, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestination, type FindPayoutDestinationMerchant, type FindPayoutDestinationUser, type GetAPayoutDestinationMerchant, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationData, type PayoutDestinationMerchantData, type PayoutDestinationMerchantResponse, type PayoutDestinationResponse, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var G=Object.create;var l=Object.defineProperty;var
|
|
1
|
+
"use strict";var G=Object.create;var l=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var N=(a,e)=>{for(var t in e)l(a,t,{get:e[t],enumerable:!0})},$=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of z(e))!H.call(a,n)&&n!==t&&l(a,n,{get:()=>e[n],enumerable:!(r=S(e,n))||r.enumerable});return a};var O=(a,e,t)=>(t=a!=null?G(L(a)):{},$(e||!a||!a.__esModule?l(t,"default",{value:a,enumerable:!0}):t,a)),Q=a=>$(l({},"__esModule",{value:!0}),a);var K={};N(K,{MorambaClient:()=>v,UserType:()=>I,monadApprove:()=>F,sepoliaApprove:()=>J});module.exports=Q(K);var E=O(require("axios")),y=class{constructor(e,t={},r=4,n=300){this.client=E.default.create({baseURL:e,headers:t,timeout:1e4}),this.maxRetries=r,this.retryDelay=n,this.setupRetryInterceptor()}get axiosInstance(){return this.client}setupRetryInterceptor(){this.client.interceptors.response.use(e=>e,async e=>{var o;let t=e.config;if(!t)throw e;let r=(o=e.response)==null?void 0:o.status;if(r&&r>=400&&r<500&&r!==429||(t._retryCount||(t._retryCount=0),t._retryCount>=this.maxRetries))throw e;t._retryCount++;let n=this.retryDelay*Math.pow(2,t._retryCount);return await new Promise(m=>setTimeout(m,n)),this.client(t)})}post(e,t,r={}){return this.client.post(e,t,{headers:r}).then(n=>n.data)}patch(e,t,r={}){return this.client.patch(e,t,{headers:r}).then(n=>n.data)}get(e,t={}){return this.client.get(e,{headers:t}).then(r=>r.data)}};var k=require("ulid"),g=class{constructor(e,t,r){this.http=e;this.partnerId=t;this.apiKey=r}createJwtToken(e){let t={...e,partner_id:this.partnerId,api_key:this.apiKey};return this.http.post("/morambacrypto/create/jwt_token",t)}createJwtTokenForPublic(){let t={userid:`public_user_${(0,k.ulid)()}@morambacrypto.moramba.io`,partner_id:this.partnerId};return this.http.post("/morambacrypto/create/jwt_token",t)}};var P=class{constructor(e){this.http=e}createCompany(e,t){return this.http.post("/morambacrypto/create/company",e,{Authorization:`Bearer ${t}`})}updateCompanyEmail(e,t){return this.http.patch("/morambacrypto/update/company/email",e,{Authorization:`Bearer ${t}`})}getCompaniesByPartner(e,t){let r=new URLSearchParams;return t.limit&&r.append("limit",String(t.limit)),t.direction&&r.append("direction",t.direction),t.cursor&&r.append("cursor",t.cursor),this.http.get(`/morambacrypto/companies/partner/${t.partner_id}?${r.toString()}`,{Authorization:`Bearer ${e}`})}updateCompanyPaymentMethod(e,t){return this.http.patch("/morambacrypto/update/company/payment",e,{Authorization:`Bearer ${t}`})}};var f=class{constructor(e){this.http=e}createMerchant(e,t){return this.http.post("/morambacrypto/create/merchant",e,{Authorization:`Bearer ${t}`})}updateMerchantPaymentMethod(e,t){return this.http.patch("/morambacrypto/update/merchant/payment",e,{Authorization:`Bearer ${t}`})}updateMerchantEmail(e,t){return this.http.patch("/morambacrypto/update/merchant/email",e,{Authorization:`Bearer ${t}`})}getMerchantList(e,t={}){let r=new URLSearchParams;return t.company_id&&r.append("company_id",String(t.company_id)),t.limit&&r.append("limit",String(t.limit)),t.cursor&&r.append("cursor",t.cursor),t.forward&&r.append("cursor",t.forward),t.backward&&r.append("cursor",t.backward),this.http.get(`/morambacrypto/merchants/all?${r.toString()}`,{Authorization:`Bearer ${e}`})}getSingleMerchant(e,t={}){let r=new URLSearchParams;return t.merchant_id&&r.append("merchant_id",String(t.merchant_id)),this.http.get(`/morambacrypto/merchants?${r.toString()}`,{Authorization:`Bearer ${e}`})}};var U=class{constructor(e){this.http=e}createUser(e,t){return this.http.post("/morambacrypto/create/user",e,{Authorization:`Bearer ${t}`})}updateUserPaymentMethod(e,t){return this.http.patch("/morambacrypto/update/user/payment",e,{Authorization:`Bearer ${t}`})}updateUserEmail(e,t){return this.http.patch("/morambacrypto/update/user/email",e,{Authorization:`Bearer ${t}`})}getUserList(e,t={}){let r=new URLSearchParams;return t.company_id&&r.append("company_id",String(t.company_id)),t.limit&&r.append("limit",String(t.limit)),t.cursor&&r.append("cursor",t.cursor),t.forward&&r.append("cursor",t.forward),t.backward&&r.append("cursor",t.backward),this.http.get(`/morambacrypto/users/all?${r.toString()}`,{Authorization:`Bearer ${e}`})}getSingleUser(e,t={}){let r=new URLSearchParams;return t.merchant_id&&r.append("merchant_id",String(t.merchant_id)),this.http.get(`/morambacrypto/users?${r.toString()}`,{Authorization:`Bearer ${e}`})}};var C=class{constructor(e){this.http=e}createPayoutDestinationUser(e,t){return this.http.post(`/morambacrypto/create/payout-destination/for/${e.user_type}`,e,{Authorization:`Bearer ${t}`})}getPayoutDestinationUser(e,t){return this.http.get(`/morambacrypto/payout-destination/for/${e.user_type}/details?payout_destination_id=${e.payout_destination_id}`,{Authorization:`Bearer ${t}`})}};var _=class{constructor(e){this.http=e}createPayinUser(e,t){return this.http.post(`/morambacrypto/create/payin/for/${e.user_type}`,e,{Authorization:`Bearer ${t}`})}getPayinUser(e,t){return this.http.get(`/morambacrypto/payin/for/${e.user_type}/details?payin_id=${e.payin_id}`,{Authorization:`Bearer ${t}`})}};var b=class{constructor(e){this.http=e}initPayment(e,t){return this.http.get(`/morambacrypto/payrequest/init/${e.payin_id}/nt/monad/address/${e.address}`,{Authorization:`Bearer ${t}`})}Pay(e,t){return this.http.post(`/morambacrypto/payrequest/pay/${e.payin_id}/nt/monad/tnxid/${e.transaction_id}/relay`,e,{Authorization:`Bearer ${t}`})}};var x=class{constructor(e){this.http=e}createPayoutDestinationMerchant(e,t){return this.http.post("/morambacrypto/create/payout-destination/merchant",e,{Authorization:`Bearer ${t}`})}getPayoutDestinationMerchant(e,t){return this.http.get(`/morambacrypto/payout-destination/merchant?payout_destination_id=${e.payout_destination_id}`,{Authorization:`Bearer ${t}`})}};var A=class{constructor(e){this.http=e}getPayoutDestination(e,t){return this.http.get(`/morambacrypto/payout-destination/check/both/by-id?payout_destination_id=${e.payout_destination_id}`,{Authorization:`Bearer ${t}`})}};var R=class{constructor(e){this.http=e}createPayinButton(e,t){return this.http.post("/morambacrypto/payin/create/button",e,{Authorization:`Bearer ${t}`})}};var v=class{constructor(e){this.http=new y(e.baseURL,{"Content-Type":"application/json"}),this.auth=new g(this.http,e.partnerId,e.apiKey),this.company=new P(this.http),this.merchant=new f(this.http),this.user=new U(this.http),this.payoutDestinationUser=new C(this.http),this.payinUser=new _(this.http),this.pay=new b(this.http),this.payoutDestinationMerchant=new x(this.http),this.payoutDestination=new A(this.http),this.payinButton=new R(this.http)}};var I=(o=>(o.CUSTOMER="customer",o.VENDOR="vendor",o.AI_AGENT="AI_agent",o.DEVICE="device",o.OTHER="other",o))(I||{});var s=require("ethers");var T={rpc:"https://testnet-rpc.monad.xyz",spender:"0x778501615Dfd26e42e58b233325ebE352f848F01",token:"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4",decimals:6,defaultAmount:"1000"},B={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function F(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=a,o=T,m=new s.ethers.JsonRpcProvider(o.rpc),c=new s.ethers.Wallet(e,m),w=["function approve(address spender, uint256 value) external returns (bool)"],D=new s.ethers.Contract(o.token,w,c),d=n!=null?n:o.decimals,h=r!=null?r:o.defaultAmount,M=t?s.ethers.MaxUint256:s.ethers.parseUnits(h,d);console.log("\u26A1 Monad approve()"),console.log("RPC:",o.rpc),console.log("Token:",o.token),console.log("Spender:",o.spender),console.log("Decimals:",d),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let i=await D.approve(o.spender,M);console.log("\u{1F4E4} TX:",i.hash);let u=await i.wait();return console.log("\u2705 Block:",u.blockNumber),{hash:i.hash,receipt:u}}var p=require("ethers");async function J(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=a,o=B,m=new p.ethers.JsonRpcProvider(o.rpc),c=new p.ethers.Wallet(e,m),w=["function approve(address spender, uint256 value) external returns (bool)"],D=new p.ethers.Contract(o.token,w,c),d=n!=null?n:o.decimals,h=r!=null?r:o.defaultAmount,M=t?p.ethers.MaxUint256:p.ethers.parseUnits(h,d);console.log("\u26A1 Sepolia approve()"),console.log("RPC:",o.rpc),console.log("Token:",o.token),console.log("Spender:",o.spender),console.log("Decimals:",d),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let i=await D.approve(o.spender,M);console.log("\u{1F4E4} TX:",i.hash);let u=await i.wait();return console.log("\u2705 Block:",u.blockNumber),{hash:i.hash,receipt:u}}0&&(module.exports={MorambaClient,UserType,monadApprove,sepoliaApprove});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/client/HttpClient.ts","../src/apis/auth.api.ts","../src/apis/company.api.ts","../src/apis/merchant.api.ts","../src/apis/user.api.ts","../src/apis/payout_destination_user.api.ts","../src/apis/payin_user.api.ts","../src/apis/pay.api.ts","../src/apis/payout_destination_merchant.api.ts","../src/apis/payout_destination.api.ts","../src/MorambaClient.ts","../src/types/user.types.ts","../src/authorize/monad.approve.ts","../src/utils/networks.ts","../src/authorize/sepolia.approve.ts"],"sourcesContent":["export * from \"./MorambaClient\";\nexport * from \"./types\";\nexport * from \"./authorize\";\n","import axios, { AxiosInstance, AxiosError } from \"axios\";\n\nexport class HttpClient {\n private client: AxiosInstance;\n private maxRetries: number;\n private retryDelay: number; // base delay in milliseconds\n\n constructor(\n baseURL: string,\n headers: Record<string, string> = {},\n maxRetries = 4, // default: 4 retries\n retryDelay = 300 // base delay: 300ms\n ) {\n this.client = axios.create({\n baseURL,\n headers,\n timeout: 10000,\n });\n\n this.maxRetries = maxRetries;\n this.retryDelay = retryDelay;\n\n this.setupRetryInterceptor();\n }\n\n get axiosInstance(): AxiosInstance {\n return this.client;\n }\n\n private setupRetryInterceptor() {\n this.client.interceptors.response.use(\n response => response,\n async (error: AxiosError) => {\n const config: any = error.config;\n\n if (!config) throw error;\n const status = error.response?.status;\n\n // ✅ Do NOT retry on 400 Bad Request\n if (status && status >= 400 && status < 500 && status !== 429) {\n throw error;\n }\n\n // initialize retry counter\n if (!config._retryCount) config._retryCount = 0;\n\n // stop retry if max reached\n if (config._retryCount >= this.maxRetries) {\n throw error;\n }\n\n config._retryCount++;\n\n // exponential delay: delay * 2^(retryCount)\n const delay =\n this.retryDelay * Math.pow(2, config._retryCount);\n\n await new Promise(resolve => setTimeout(resolve, delay));\n\n return this.client(config);\n }\n );\n }\n post<T = any>(url: string, data: any, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .post<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n patch<T = any>(\n url: string,\n data: any,\n extraHeaders: Record<string, string> = {}\n ): Promise<T> {\n return this.client\n .patch<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n get<T = any>(url: string, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .get<T>(url, { headers: extraHeaders })\n .then((res) => res.data);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateJwtPayload,\n CreateJwtResponse,\n} from \"../types/auth.types\";\nimport { ulid } from \"ulid\";\n\nexport class AuthAPI {\n constructor(\n private http: HttpClient,\n private partnerId: string,\n private apiKey: string\n\n ) { }\n\n createJwtToken(payload: CreateJwtPayload): Promise<CreateJwtResponse> {\n let fullPayload = {\n ...payload,\n partner_id: this.partnerId,\n api_key: this.apiKey,\n };\n\n\n\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n\n createJwtTokenForPublic(): Promise<CreateJwtResponse> {\n let userid = `public_user_${ulid()}@morambacrypto.moramba.io`;\n let fullPayload = {\n userid: userid,\n partner_id: this.partnerId,\n };\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateCompanyPayload,\n CreateCompanyResponse,\n UpdateCompanyEmailPayload,\n UpdateCompanyEmailResponse,\n GetCompaniesQuery,\n GetCompaniesResponse,\n UpdateCompanyPaymentPayload,\n UpdateCompanyPaymentResponse,\n} from \"../types/company.types\";\n\nexport class CompanyAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n createCompany(payload: CreateCompanyPayload, jwtToken: string): Promise<CreateCompanyResponse> {\n\n return this.http.post(\n \"/morambacrypto/create/company\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyEmail(\n payload: UpdateCompanyEmailPayload,\n jwtToken: string\n ): Promise<UpdateCompanyEmailResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getCompaniesByPartner(\n jwtToken: string,\n query: GetCompaniesQuery\n ): Promise<GetCompaniesResponse> {\n const params = new URLSearchParams();\n\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.direction) params.append(\"direction\", query.direction);\n if (query.cursor) params.append(\"cursor\", query.cursor);\n\n return this.http.get(\n `/morambacrypto/companies/partner/${query.partner_id}?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyPaymentMethod(\n payload: UpdateCompanyPaymentPayload,\n jwtToken: string\n ): Promise<UpdateCompanyPaymentResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreateMerchantPayload, CreateMerchantResponse, GetMerchantListResponse, GetMerchantQuery, GetMerchantResponse, MerchantListQuery, UpdateMerchantEmailPayload, UpdateMerchantEmailResponse, UpdateMerchantPaymentPayload, UpdateMerchantPaymentResponse } from \"../types/merchant.types\";\n\nexport class MerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createMerchant(payload: CreateMerchantPayload, jwtToken: string): Promise<CreateMerchantResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/merchant\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantPaymentMethod(\n payload: UpdateMerchantPaymentPayload,\n jwtToken: string\n ): Promise<UpdateMerchantPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantEmail(\n payload: UpdateMerchantEmailPayload,\n jwtToken: string\n ): Promise<UpdateMerchantEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getMerchantList(\n jwtToken: string,\n query: MerchantListQuery = {}\n ): Promise<GetMerchantListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/merchants/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleMerchant(\n jwtToken: string,\n query: GetMerchantQuery = {}\n ): Promise<GetMerchantResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/merchants?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreateUserPayload, CreateUserResponse, GetUserListResponse, GetUserQuery, GetUserResponse, UpdateUserEmailPayload, UpdateUserEmailResponse, UpdateUserPaymentPayload, UpdateUserPaymentResponse, UserListQuery } from \"../types/user.types\";\n\nexport class UserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createUser(payload: CreateUserPayload, jwtToken: string): Promise<CreateUserResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/user\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserPaymentMethod(\n payload: UpdateUserPaymentPayload,\n jwtToken: string\n ): Promise<UpdateUserPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserEmail(\n payload: UpdateUserEmailPayload,\n jwtToken: string\n ): Promise<UpdateUserEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getUserList(\n jwtToken: string,\n query: UserListQuery = {}\n ): Promise<GetUserListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/users/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleUser(\n jwtToken: string,\n query: GetUserQuery = {}\n ): Promise<GetUserResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/users?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationUser, GetAPayoutDestinationUser, PayoutDestinationUserResponse } from \"../types/payout_destination_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayoutDestinationUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationUser(payload: CreatePayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationUser(payload: GetAPayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/for/${payload.user_type as UserType}/details?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayinUser, GetPayinUser, PayinUserResponse } from \"../types/payin_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayinUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayinUser(payload: CreatePayinUser, jwtToken: string): Promise<PayinUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payin/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayinUser(payload: GetPayinUser, jwtToken: string): Promise<PayinUserResponse> {\n return this.http.get(\n `/morambacrypto/payin/for/${payload.user_type as UserType}/details?payin_id=${payload.payin_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { InitTransaction, PayTransaction, TransactionInitResponse, TransactionPayResponse } from \"../types\";\nexport class PayAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n initPayment(payload: InitTransaction, jwtToken: string): Promise<TransactionInitResponse> {\n return this.http.get(\n `/morambacrypto/payrequest/init/${payload.payin_id}/nt/monad/address/${payload.address}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n Pay(payload: PayTransaction, jwtToken: string): Promise<TransactionPayResponse> {\n return this.http.post(\n `/morambacrypto/payrequest/pay/${payload.payin_id}/nt/monad/tnxid/${payload.transaction_id}/relay`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationMerchant, GetAPayoutDestinationMerchant, PayoutDestinationMerchantResponse } from \"../types/payout_destination_merchant.types\";\n\nexport class PayoutDestinationMerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationMerchant(payload: CreatePayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/merchant`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationMerchant(payload: GetAPayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/merchant?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { FindPayoutDestination, PayoutDestinationResponse } from \"../types/payout_destination.types\";\n\nexport class PayoutDestinationAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n getPayoutDestination(payload: FindPayoutDestination, jwtToken: string): Promise<PayoutDestinationResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/check/both/by-id?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"./client/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinUserAPI, PayoutDestinationAPI, PayoutDestinationUserAPI } from \"./apis\";\nimport { PayoutDestinationMerchantAPI } from \"./apis/payout_destination_merchant.api\";\n\nexport interface MorambaClientConfig {\n baseURL: string;\n apiKey: string;\n partnerId: string;\n}\n\nexport class MorambaClient {\n public auth: AuthAPI;\n private http: HttpClient;\n public company: CompanyAPI;\n public merchant: MerchantAPI;\n public user: UserAPI;\n public payoutDestinationUser: PayoutDestinationUserAPI;\n public payinUser: PayinUserAPI;\n public pay: PayAPI;\n public payoutDestinationMerchant: PayoutDestinationMerchantAPI;\n public payoutDestination: PayoutDestinationAPI;\n\n\n constructor(config: MorambaClientConfig) {\n this.http = new HttpClient(config.baseURL, {\n \"Content-Type\": \"application/json\",\n });\n\n this.auth = new AuthAPI(this.http, config.partnerId, config.apiKey);\n this.company = new CompanyAPI(this.http);\n this.merchant = new MerchantAPI(this.http);\n this.user = new UserAPI(this.http);\n this.payoutDestinationUser = new PayoutDestinationUserAPI(this.http);\n this.payinUser = new PayinUserAPI(this.http);\n this.pay = new PayAPI(this.http);\n this.payoutDestinationMerchant = new PayoutDestinationMerchantAPI(this.http);\n this.payoutDestination = new PayoutDestinationAPI(this.http);\n }\n}\n","import { PaymentMethod } from \"./payment_method.types\";\n\nexport enum UserType {\n CUSTOMER = \"customer\",\n VENDOR = \"vendor\",\n AI_AGENT = \"AI_agent\",\n DEVICE = \"device\",\n OTHER = \"other\",\n}\nexport interface CreateUserPayload {\n payment_method: PaymentMethod;\n user_name: string;\n user_email: string;\n user_type: UserType;\n company_id: string;\n merchant_id: string;\n}\n\nexport interface UserData {\n id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n company_id: string;\n partner_id: string;\n user_type: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CreateUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\nexport interface UpdateUserPaymentPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n payment_method: PaymentMethod;\n}\nexport interface UpdateUserPaymentResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UpdateUserEmailPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n email: string;\n}\n\nexport interface UpdateUserEmailResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UserListQuery {\n company_id?: string;\n limit?: number;\n cursor?: string;\n forward?: string;\n backward?: string;\n}\n\nexport interface UserListData {\n id: string;\n company_id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n partner_id: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n\n}\nexport interface GetUserListResponse {\n forward_cursor: string;\n backward_cursor: string;\n has_forward: boolean;\n has_backward: boolean;\n data: UserListData | null;\n}\n\nexport interface GetUserQuery {\n merchant_id?: string;\n}\n\nexport interface GetUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}","\nimport { ethers } from \"ethers\";\nimport { MONAD_CONFIG } from \"../utils/networks\";\n\nexport interface MonadApproveOptions {\n privateKey: string;\n unlimited?: boolean; // default: true\n amount?: string; // user-specified amount when limited\n decimalsOverride?: number; // optional override\n}\n\nexport async function monadApprove(options: MonadApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = MONAD_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Monad approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n","\nexport interface TokenNetworkConfig {\n rpc: string;\n spender: string;\n token: string;\n decimals: number;\n defaultAmount: string;\n}\n\n// ▶️ MORAMBA Token (Monad)\nexport const MONAD_CONFIG: TokenNetworkConfig = {\n rpc: \"https://testnet-rpc.monad.xyz\",\n spender: \"0x778501615Dfd26e42e58b233325ebE352f848F01\",\n token: \"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n\n// ▶️ Sepolia \nexport const SEPOLIA_CONFIG: TokenNetworkConfig = {\n rpc: \"https://rpc.sepolia.org\",\n spender: \"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab\",\n token: \"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n","import { ethers } from \"ethers\";\nimport { SEPOLIA_CONFIG } from \"../utils/networks\";\n\nexport interface SepoliaApproveOptions {\n privateKey: string;\n unlimited?: boolean;\n amount?: string;\n decimalsOverride?: number;\n}\n\nexport async function sepoliaApprove(options: SepoliaApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = SEPOLIA_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Sepolia approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,aAAAC,EAAA,iBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAN,GCAA,IAAAO,EAAiD,oBAEpCC,EAAN,KAAiB,CAKpB,YACIC,EACAC,EAAkC,CAAC,EACnCC,EAAa,EACbC,EAAa,IACf,CACE,KAAK,OAAS,EAAAC,QAAM,OAAO,CACvB,QAAAJ,EACA,QAAAC,EACA,QAAS,GACb,CAAC,EAED,KAAK,WAAaC,EAClB,KAAK,WAAaC,EAElB,KAAK,sBAAsB,CAC/B,CAEA,IAAI,eAA+B,CAC/B,OAAO,KAAK,MAChB,CAEQ,uBAAwB,CAC5B,KAAK,OAAO,aAAa,SAAS,IAC9BE,GAAYA,EACZ,MAAOC,GAAsB,CAhCzC,IAAAC,EAiCgB,IAAMC,EAAcF,EAAM,OAE1B,GAAI,CAACE,EAAQ,MAAMF,EACnB,IAAMG,GAASF,EAAAD,EAAM,WAAN,Y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baseURL","headers","maxRetries","retryDelay","axios","response","error","_a","config","status","delay","resolve","url","data","extraHeaders","res","import_ulid","AuthAPI","http","partnerId","apiKey","payload","fullPayload","CompanyAPI","http","payload","jwtToken","query","params","MerchantAPI","http","payload","jwtToken","query","params","UserAPI","http","payload","jwtToken","query","params","PayoutDestinationUserAPI","http","payload","jwtToken","PayinUserAPI","http","payload","jwtToken","PayAPI","http","payload","jwtToken","PayoutDestinationMerchantAPI","http","payload","jwtToken","PayoutDestinationAPI","http","payload","jwtToken","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","UserType","import_ethers","MONAD_CONFIG","SEPOLIA_CONFIG","monadApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","MONAD_CONFIG","provider","wallet","abi","contract","decimals","humanAmount","value","tx","receipt","import_ethers","sepoliaApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","SEPOLIA_CONFIG","provider","wallet","abi","contract","decimals","humanAmount","value","tx","receipt"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/client/HttpClient.ts","../src/apis/auth.api.ts","../src/apis/company.api.ts","../src/apis/merchant.api.ts","../src/apis/user.api.ts","../src/apis/payout_destination_user.api.ts","../src/apis/payin_user.api.ts","../src/apis/pay.api.ts","../src/apis/payout_destination_merchant.api.ts","../src/apis/payout_destination.api.ts","../src/apis/payin_button.api.ts","../src/MorambaClient.ts","../src/types/user.types.ts","../src/authorize/monad.approve.ts","../src/utils/networks.ts","../src/authorize/sepolia.approve.ts"],"sourcesContent":["export * from \"./MorambaClient\";\nexport * from \"./types\";\nexport * from \"./authorize\";\n","import axios, { AxiosInstance, AxiosError } from \"axios\";\n\nexport class HttpClient {\n private client: AxiosInstance;\n private maxRetries: number;\n private retryDelay: number; // base delay in milliseconds\n\n constructor(\n baseURL: string,\n headers: Record<string, string> = {},\n maxRetries = 4, // default: 4 retries\n retryDelay = 300 // base delay: 300ms\n ) {\n this.client = axios.create({\n baseURL,\n headers,\n timeout: 10000,\n });\n\n this.maxRetries = maxRetries;\n this.retryDelay = retryDelay;\n\n this.setupRetryInterceptor();\n }\n\n get axiosInstance(): AxiosInstance {\n return this.client;\n }\n\n private setupRetryInterceptor() {\n this.client.interceptors.response.use(\n response => response,\n async (error: AxiosError) => {\n const config: any = error.config;\n\n if (!config) throw error;\n const status = error.response?.status;\n\n // ✅ Do NOT retry on 400 Bad Request\n if (status && status >= 400 && status < 500 && status !== 429) {\n throw error;\n }\n\n // initialize retry counter\n if (!config._retryCount) config._retryCount = 0;\n\n // stop retry if max reached\n if (config._retryCount >= this.maxRetries) {\n throw error;\n }\n\n config._retryCount++;\n\n // exponential delay: delay * 2^(retryCount)\n const delay =\n this.retryDelay * Math.pow(2, config._retryCount);\n\n await new Promise(resolve => setTimeout(resolve, delay));\n\n return this.client(config);\n }\n );\n }\n post<T = any>(url: string, data: any, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .post<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n patch<T = any>(\n url: string,\n data: any,\n extraHeaders: Record<string, string> = {}\n ): Promise<T> {\n return this.client\n .patch<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n get<T = any>(url: string, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .get<T>(url, { headers: extraHeaders })\n .then((res) => res.data);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateJwtPayload,\n CreateJwtResponse,\n} from \"../types/auth.types\";\nimport { ulid } from \"ulid\";\n\nexport class AuthAPI {\n constructor(\n private http: HttpClient,\n private partnerId: string,\n private apiKey: string\n\n ) { }\n\n createJwtToken(payload: CreateJwtPayload): Promise<CreateJwtResponse> {\n let fullPayload = {\n ...payload,\n partner_id: this.partnerId,\n api_key: this.apiKey,\n };\n\n\n\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n\n createJwtTokenForPublic(): Promise<CreateJwtResponse> {\n let userid = `public_user_${ulid()}@morambacrypto.moramba.io`;\n let fullPayload = {\n userid: userid,\n partner_id: this.partnerId,\n };\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateCompanyPayload,\n CreateCompanyResponse,\n UpdateCompanyEmailPayload,\n UpdateCompanyEmailResponse,\n GetCompaniesQuery,\n GetCompaniesResponse,\n UpdateCompanyPaymentPayload,\n UpdateCompanyPaymentResponse,\n} from \"../types/company.types\";\n\nexport class CompanyAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n createCompany(payload: CreateCompanyPayload, jwtToken: string): Promise<CreateCompanyResponse> {\n\n return this.http.post(\n \"/morambacrypto/create/company\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyEmail(\n payload: UpdateCompanyEmailPayload,\n jwtToken: string\n ): Promise<UpdateCompanyEmailResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getCompaniesByPartner(\n jwtToken: string,\n query: GetCompaniesQuery\n ): Promise<GetCompaniesResponse> {\n const params = new URLSearchParams();\n\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.direction) params.append(\"direction\", query.direction);\n if (query.cursor) params.append(\"cursor\", query.cursor);\n\n return this.http.get(\n `/morambacrypto/companies/partner/${query.partner_id}?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyPaymentMethod(\n payload: UpdateCompanyPaymentPayload,\n jwtToken: string\n ): Promise<UpdateCompanyPaymentResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreateMerchantPayload, CreateMerchantResponse, GetMerchantListResponse, GetMerchantQuery, GetMerchantResponse, MerchantListQuery, UpdateMerchantEmailPayload, UpdateMerchantEmailResponse, UpdateMerchantPaymentPayload, UpdateMerchantPaymentResponse } from \"../types/merchant.types\";\n\nexport class MerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createMerchant(payload: CreateMerchantPayload, jwtToken: string): Promise<CreateMerchantResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/merchant\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantPaymentMethod(\n payload: UpdateMerchantPaymentPayload,\n jwtToken: string\n ): Promise<UpdateMerchantPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantEmail(\n payload: UpdateMerchantEmailPayload,\n jwtToken: string\n ): Promise<UpdateMerchantEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getMerchantList(\n jwtToken: string,\n query: MerchantListQuery = {}\n ): Promise<GetMerchantListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/merchants/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleMerchant(\n jwtToken: string,\n query: GetMerchantQuery = {}\n ): Promise<GetMerchantResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/merchants?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreateUserPayload, CreateUserResponse, GetUserListResponse, GetUserQuery, GetUserResponse, UpdateUserEmailPayload, UpdateUserEmailResponse, UpdateUserPaymentPayload, UpdateUserPaymentResponse, UserListQuery } from \"../types/user.types\";\n\nexport class UserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createUser(payload: CreateUserPayload, jwtToken: string): Promise<CreateUserResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/user\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserPaymentMethod(\n payload: UpdateUserPaymentPayload,\n jwtToken: string\n ): Promise<UpdateUserPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserEmail(\n payload: UpdateUserEmailPayload,\n jwtToken: string\n ): Promise<UpdateUserEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getUserList(\n jwtToken: string,\n query: UserListQuery = {}\n ): Promise<GetUserListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/users/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleUser(\n jwtToken: string,\n query: GetUserQuery = {}\n ): Promise<GetUserResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/users?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationUser, GetAPayoutDestinationUser, PayoutDestinationUserResponse } from \"../types/payout_destination_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayoutDestinationUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationUser(payload: CreatePayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationUser(payload: GetAPayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/for/${payload.user_type as UserType}/details?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayinUser, GetPayinUser, PayinUserResponse } from \"../types/payin_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayinUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayinUser(payload: CreatePayinUser, jwtToken: string): Promise<PayinUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payin/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayinUser(payload: GetPayinUser, jwtToken: string): Promise<PayinUserResponse> {\n return this.http.get(\n `/morambacrypto/payin/for/${payload.user_type as UserType}/details?payin_id=${payload.payin_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { InitTransaction, PayTransaction, TransactionInitResponse, TransactionPayResponse } from \"../types\";\nexport class PayAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n initPayment(payload: InitTransaction, jwtToken: string): Promise<TransactionInitResponse> {\n return this.http.get(\n `/morambacrypto/payrequest/init/${payload.payin_id}/nt/monad/address/${payload.address}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n Pay(payload: PayTransaction, jwtToken: string): Promise<TransactionPayResponse> {\n return this.http.post(\n `/morambacrypto/payrequest/pay/${payload.payin_id}/nt/monad/tnxid/${payload.transaction_id}/relay`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationMerchant, GetAPayoutDestinationMerchant, PayoutDestinationMerchantResponse } from \"../types/payout_destination_merchant.types\";\n\nexport class PayoutDestinationMerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationMerchant(payload: CreatePayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/merchant`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationMerchant(payload: GetAPayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/merchant?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { FindPayoutDestination, PayoutDestinationResponse } from \"../types/payout_destination.types\";\n\nexport class PayoutDestinationAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n getPayoutDestination(payload: FindPayoutDestination, jwtToken: string): Promise<PayoutDestinationResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/check/both/by-id?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayinButtonRequestDto } from \"../types/payin_button.types\";\nimport { PayinUserResponse } from \"../types/payin_user.types\";\nexport class PayinButtonAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayinButton(payload: CreatePayinButtonRequestDto, jwtToken: string): Promise<PayinUserResponse> {\n\n return this.http.post(\n `/morambacrypto/payin/create/button`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"./client/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinButtonAPI, PayinUserAPI, PayoutDestinationAPI, PayoutDestinationUserAPI } from \"./apis\";\nimport { PayoutDestinationMerchantAPI } from \"./apis/payout_destination_merchant.api\";\n\nexport interface MorambaClientConfig {\n baseURL: string;\n apiKey: string;\n partnerId: string;\n}\n\nexport class MorambaClient {\n public auth: AuthAPI;\n private http: HttpClient;\n public company: CompanyAPI;\n public merchant: MerchantAPI;\n public user: UserAPI;\n public payoutDestinationUser: PayoutDestinationUserAPI;\n public payinUser: PayinUserAPI;\n public pay: PayAPI;\n public payoutDestinationMerchant: PayoutDestinationMerchantAPI;\n public payoutDestination: PayoutDestinationAPI;\n public payinButton: PayinButtonAPI;\n\n\n constructor(config: MorambaClientConfig) {\n this.http = new HttpClient(config.baseURL, {\n \"Content-Type\": \"application/json\",\n });\n\n this.auth = new AuthAPI(this.http, config.partnerId, config.apiKey);\n this.company = new CompanyAPI(this.http);\n this.merchant = new MerchantAPI(this.http);\n this.user = new UserAPI(this.http);\n this.payoutDestinationUser = new PayoutDestinationUserAPI(this.http);\n this.payinUser = new PayinUserAPI(this.http);\n this.pay = new PayAPI(this.http);\n this.payoutDestinationMerchant = new PayoutDestinationMerchantAPI(this.http);\n this.payoutDestination = new PayoutDestinationAPI(this.http);\n this.payinButton = new PayinButtonAPI(this.http);\n }\n}\n","import { PaymentMethod } from \"./payment_method.types\";\n\nexport enum UserType {\n CUSTOMER = \"customer\",\n VENDOR = \"vendor\",\n AI_AGENT = \"AI_agent\",\n DEVICE = \"device\",\n OTHER = \"other\",\n}\nexport interface CreateUserPayload {\n payment_method: PaymentMethod;\n user_name: string;\n user_email: string;\n user_type: UserType;\n company_id: string;\n merchant_id: string;\n}\n\nexport interface UserData {\n id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n company_id: string;\n partner_id: string;\n user_type: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CreateUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\nexport interface UpdateUserPaymentPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n payment_method: PaymentMethod;\n}\nexport interface UpdateUserPaymentResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UpdateUserEmailPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n email: string;\n}\n\nexport interface UpdateUserEmailResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UserListQuery {\n company_id?: string;\n limit?: number;\n cursor?: string;\n forward?: string;\n backward?: string;\n}\n\nexport interface UserListData {\n id: string;\n company_id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n partner_id: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n\n}\nexport interface GetUserListResponse {\n forward_cursor: string;\n backward_cursor: string;\n has_forward: boolean;\n has_backward: boolean;\n data: UserListData | null;\n}\n\nexport interface GetUserQuery {\n merchant_id?: string;\n}\n\nexport interface GetUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}","\nimport { ethers } from \"ethers\";\nimport { MONAD_CONFIG } from \"../utils/networks\";\n\nexport interface MonadApproveOptions {\n privateKey: string;\n unlimited?: boolean; // default: true\n amount?: string; // user-specified amount when limited\n decimalsOverride?: number; // optional override\n}\n\nexport async function monadApprove(options: MonadApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = MONAD_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Monad approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n","\nexport interface TokenNetworkConfig {\n rpc: string;\n spender: string;\n token: string;\n decimals: number;\n defaultAmount: string;\n}\n\n// ▶️ MORAMBA Token (Monad)\nexport const MONAD_CONFIG: TokenNetworkConfig = {\n rpc: \"https://testnet-rpc.monad.xyz\",\n spender: \"0x778501615Dfd26e42e58b233325ebE352f848F01\",\n token: \"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n\n// ▶️ Sepolia \nexport const SEPOLIA_CONFIG: TokenNetworkConfig = {\n rpc: \"https://rpc.sepolia.org\",\n spender: \"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab\",\n token: \"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n","import { ethers } from \"ethers\";\nimport { SEPOLIA_CONFIG } from \"../utils/networks\";\n\nexport interface SepoliaApproveOptions {\n privateKey: string;\n unlimited?: boolean;\n amount?: string;\n decimalsOverride?: number;\n}\n\nexport async function sepoliaApprove(options: SepoliaApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = SEPOLIA_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Sepolia approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,aAAAC,EAAA,iBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAN,GCAA,IAAAO,EAAiD,oBAEpCC,EAAN,KAAiB,CAKpB,YACIC,EACAC,EAAkC,CAAC,EACnCC,EAAa,EACbC,EAAa,IACf,CACE,KAAK,OAAS,EAAAC,QAAM,OAAO,CACvB,QAAAJ,EACA,QAAAC,EACA,QAAS,GACb,CAAC,EAED,KAAK,WAAaC,EAClB,KAAK,WAAaC,EAElB,KAAK,sBAAsB,CAC/B,CAEA,IAAI,eAA+B,CAC/B,OAAO,KAAK,MAChB,CAEQ,uBAAwB,CAC5B,KAAK,OAAO,aAAa,SAAS,IAC9BE,GAAYA,EACZ,MAAOC,GAAsB,CAhCzC,IAAAC,EAiCgB,IAAMC,EAAcF,EAAM,OAE1B,GAAI,CAACE,EAAQ,MAAMF,EACnB,IAAMG,GAASF,EAAAD,EAAM,WAAN,YAAAC,EAAgB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,EAAG,IAAI,EAE7B,IAAMC,EAAU,MAAMD,EAAG,KAAK,EAC9B,eAAQ,IAAI,gBAAYC,EAAQ,WAAW,EAEpC,CAAE,KAAMD,EAAG,KAAM,QAAAC,CAAQ,CACpC","names":["index_exports","__export","MorambaClient","UserType","monadApprove","sepoliaApprove","__toCommonJS","import_axios","HttpClient","baseURL","headers","maxRetries","retryDelay","axios","response","error","_a","config","status","delay","resolve","url","data","extraHeaders","res","import_ulid","AuthAPI","http","partnerId","apiKey","payload","fullPayload","CompanyAPI","http","payload","jwtToken","query","params","MerchantAPI","http","payload","jwtToken","query","params","UserAPI","http","payload","jwtToken","query","params","PayoutDestinationUserAPI","http","payload","jwtToken","PayinUserAPI","http","payload","jwtToken","PayAPI","http","payload","jwtToken","PayoutDestinationMerchantAPI","http","payload","jwtToken","PayoutDestinationAPI","http","payload","jwtToken","PayinButtonAPI","http","payload","jwtToken","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","PayinButtonAPI","UserType","import_ethers","MONAD_CONFIG","SEPOLIA_CONFIG","monadApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","MONAD_CONFIG","provider","wallet","abi","contract","decimals","humanAmount","value","tx","receipt","import_ethers","sepoliaApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","SEPOLIA_CONFIG","provider","wallet","abi","contract","decimals","humanAmount","value","tx","receipt"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import E from"axios";var l=class{constructor(e,t={},r=4,n=300){this.client=E.create({baseURL:e,headers:t,timeout:1e4}),this.maxRetries=r,this.retryDelay=n,this.setupRetryInterceptor()}get axiosInstance(){return this.client}setupRetryInterceptor(){this.client.interceptors.response.use(e=>e,async e=>{var a;let t=e.config;if(!t)throw e;let r=(a=e.response)==null?void 0:a.status;if(r&&r>=400&&r<500&&r!==429||(t._retryCount||(t._retryCount=0),t._retryCount>=this.maxRetries))throw e;t._retryCount++;let n=this.retryDelay*Math.pow(2,t._retryCount);return await new Promise(s=>setTimeout(s,n)),this.client(t)})}post(e,t,r={}){return this.client.post(e,t,{headers:r}).then(n=>n.data)}patch(e,t,r={}){return this.client.patch(e,t,{headers:r}).then(n=>n.data)}get(e,t={}){return this.client.get(e,{headers:t}).then(r=>r.data)}};import{ulid as k}from"ulid";var y=class{constructor(e,t,r){this.http=e;this.partnerId=t;this.apiKey=r}createJwtToken(e){let t={...e,partner_id:this.partnerId,api_key:this.apiKey};return this.http.post("/morambacrypto/create/jwt_token",t)}createJwtTokenForPublic(){let t={userid:`public_user_${k()}@morambacrypto.moramba.io`,partner_id:this.partnerId};return this.http.post("/morambacrypto/create/jwt_token",t)}};var g=class{constructor(e){this.http=e}createCompany(e,t){return this.http.post("/morambacrypto/create/company",e,{Authorization:`Bearer ${t}`})}updateCompanyEmail(e,t){return this.http.patch("/morambacrypto/update/company/email",e,{Authorization:`Bearer ${t}`})}getCompaniesByPartner(e,t){let r=new URLSearchParams;return t.limit&&r.append("limit",String(t.limit)),t.direction&&r.append("direction",t.direction),t.cursor&&r.append("cursor",t.cursor),this.http.get(`/morambacrypto/companies/partner/${t.partner_id}?${r.toString()}`,{Authorization:`Bearer ${e}`})}updateCompanyPaymentMethod(e,t){return this.http.patch("/morambacrypto/update/company/payment",e,{Authorization:`Bearer ${t}`})}};var P=class{constructor(e){this.http=e}createMerchant(e,t){return this.http.post("/morambacrypto/create/merchant",e,{Authorization:`Bearer ${t}`})}updateMerchantPaymentMethod(e,t){return this.http.patch("/morambacrypto/update/merchant/payment",e,{Authorization:`Bearer ${t}`})}updateMerchantEmail(e,t){return this.http.patch("/morambacrypto/update/merchant/email",e,{Authorization:`Bearer ${t}`})}getMerchantList(e,t={}){let r=new URLSearchParams;return t.company_id&&r.append("company_id",String(t.company_id)),t.limit&&r.append("limit",String(t.limit)),t.cursor&&r.append("cursor",t.cursor),t.forward&&r.append("cursor",t.forward),t.backward&&r.append("cursor",t.backward),this.http.get(`/morambacrypto/merchants/all?${r.toString()}`,{Authorization:`Bearer ${e}`})}getSingleMerchant(e,t={}){let r=new URLSearchParams;return t.merchant_id&&r.append("merchant_id",String(t.merchant_id)),this.http.get(`/morambacrypto/merchants?${r.toString()}`,{Authorization:`Bearer ${e}`})}};var f=class{constructor(e){this.http=e}createUser(e,t){return this.http.post("/morambacrypto/create/user",e,{Authorization:`Bearer ${t}`})}updateUserPaymentMethod(e,t){return this.http.patch("/morambacrypto/update/user/payment",e,{Authorization:`Bearer ${t}`})}updateUserEmail(e,t){return this.http.patch("/morambacrypto/update/user/email",e,{Authorization:`Bearer ${t}`})}getUserList(e,t={}){let r=new URLSearchParams;return t.company_id&&r.append("company_id",String(t.company_id)),t.limit&&r.append("limit",String(t.limit)),t.cursor&&r.append("cursor",t.cursor),t.forward&&r.append("cursor",t.forward),t.backward&&r.append("cursor",t.backward),this.http.get(`/morambacrypto/users/all?${r.toString()}`,{Authorization:`Bearer ${e}`})}getSingleUser(e,t={}){let r=new URLSearchParams;return t.merchant_id&&r.append("merchant_id",String(t.merchant_id)),this.http.get(`/morambacrypto/users?${r.toString()}`,{Authorization:`Bearer ${e}`})}};var U=class{constructor(e){this.http=e}createPayoutDestinationUser(e,t){return this.http.post(`/morambacrypto/create/payout-destination/for/${e.user_type}`,e,{Authorization:`Bearer ${t}`})}getPayoutDestinationUser(e,t){return this.http.get(`/morambacrypto/payout-destination/for/${e.user_type}/details?payout_destination_id=${e.payout_destination_id}`,{Authorization:`Bearer ${t}`})}};var C=class{constructor(e){this.http=e}createPayinUser(e,t){return this.http.post(`/morambacrypto/create/payin/for/${e.user_type}`,e,{Authorization:`Bearer ${t}`})}getPayinUser(e,t){return this.http.get(`/morambacrypto/payin/for/${e.user_type}/details?payin_id=${e.payin_id}`,{Authorization:`Bearer ${t}`})}};var _=class{constructor(e){this.http=e}initPayment(e,t){return this.http.get(`/morambacrypto/payrequest/init/${e.payin_id}/nt/monad/address/${e.address}`,{Authorization:`Bearer ${t}`})}Pay(e,t){return this.http.post(`/morambacrypto/payrequest/pay/${e.payin_id}/nt/monad/tnxid/${e.transaction_id}/relay`,e,{Authorization:`Bearer ${t}`})}};var b=class{constructor(e){this.http=e}createPayoutDestinationMerchant(e,t){return this.http.post("/morambacrypto/create/payout-destination/merchant",e,{Authorization:`Bearer ${t}`})}getPayoutDestinationMerchant(e,t){return this.http.get(`/morambacrypto/payout-destination/merchant?payout_destination_id=${e.payout_destination_id}`,{Authorization:`Bearer ${t}`})}};var x=class{constructor(e){this.http=e}getPayoutDestination(e,t){return this.http.get(`/morambacrypto/payout-destination/check/both/by-id?payout_destination_id=${e.payout_destination_id}`,{Authorization:`Bearer ${t}`})}};var A=class{constructor(e){this.http=e}createPayinButton(e,t){return this.http.post("/morambacrypto/payin/create/button",e,{Authorization:`Bearer ${t}`})}};var M=class{constructor(e){this.http=new l(e.baseURL,{"Content-Type":"application/json"}),this.auth=new y(this.http,e.partnerId,e.apiKey),this.company=new g(this.http),this.merchant=new P(this.http),this.user=new f(this.http),this.payoutDestinationUser=new U(this.http),this.payinUser=new C(this.http),this.pay=new _(this.http),this.payoutDestinationMerchant=new b(this.http),this.payoutDestination=new x(this.http),this.payinButton=new A(this.http)}};var I=(a=>(a.CUSTOMER="customer",a.VENDOR="vendor",a.AI_AGENT="AI_agent",a.DEVICE="device",a.OTHER="other",a))(I||{});import{ethers as h}from"ethers";var v={rpc:"https://testnet-rpc.monad.xyz",spender:"0x778501615Dfd26e42e58b233325ebE352f848F01",token:"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4",decimals:6,defaultAmount:"1000"},$={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function $t(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=v,s=new h.JsonRpcProvider(a.rpc),p=new h.Wallet(e,s),R=["function approve(address spender, uint256 value) external returns (bool)"],w=new h.Contract(a.token,R,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,D=t?h.MaxUint256:h.parseUnits(c,m);console.log("\u26A1 Monad approve()"),console.log("RPC:",a.rpc),console.log("Token:",a.token),console.log("Spender:",a.spender),console.log("Decimals:",m),console.log("Amount:",t?"UNLIMITED":c),console.log("From:",await p.getAddress());let i=await w.approve(a.spender,D);console.log("\u{1F4E4} TX:",i.hash);let d=await i.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:i.hash,receipt:d}}import{ethers as u}from"ethers";async function Tt(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=$,s=new u.JsonRpcProvider(a.rpc),p=new u.Wallet(e,s),R=["function approve(address spender, uint256 value) external returns (bool)"],w=new u.Contract(a.token,R,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,D=t?u.MaxUint256:u.parseUnits(c,m);console.log("\u26A1 Sepolia approve()"),console.log("RPC:",a.rpc),console.log("Token:",a.token),console.log("Spender:",a.spender),console.log("Decimals:",m),console.log("Amount:",t?"UNLIMITED":c),console.log("From:",await p.getAddress());let i=await w.approve(a.spender,D);console.log("\u{1F4E4} TX:",i.hash);let d=await i.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:i.hash,receipt:d}}export{M as MorambaClient,I as UserType,$t as monadApprove,Tt as sepoliaApprove};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client/HttpClient.ts","../src/apis/auth.api.ts","../src/apis/company.api.ts","../src/apis/merchant.api.ts","../src/apis/user.api.ts","../src/apis/payout_destination_user.api.ts","../src/apis/payin_user.api.ts","../src/apis/pay.api.ts","../src/apis/payout_destination_merchant.api.ts","../src/apis/payout_destination.api.ts","../src/MorambaClient.ts","../src/types/user.types.ts","../src/authorize/monad.approve.ts","../src/utils/networks.ts","../src/authorize/sepolia.approve.ts"],"sourcesContent":["import axios, { AxiosInstance, AxiosError } from \"axios\";\n\nexport class HttpClient {\n private client: AxiosInstance;\n private maxRetries: number;\n private retryDelay: number; // base delay in milliseconds\n\n constructor(\n baseURL: string,\n headers: Record<string, string> = {},\n maxRetries = 4, // default: 4 retries\n retryDelay = 300 // base delay: 300ms\n ) {\n this.client = axios.create({\n baseURL,\n headers,\n timeout: 10000,\n });\n\n this.maxRetries = maxRetries;\n this.retryDelay = retryDelay;\n\n this.setupRetryInterceptor();\n }\n\n get axiosInstance(): AxiosInstance {\n return this.client;\n }\n\n private setupRetryInterceptor() {\n this.client.interceptors.response.use(\n response => response,\n async (error: AxiosError) => {\n const config: any = error.config;\n\n if (!config) throw error;\n const status = error.response?.status;\n\n // ✅ Do NOT retry on 400 Bad Request\n if (status && status >= 400 && status < 500 && status !== 429) {\n throw error;\n }\n\n // initialize retry counter\n if (!config._retryCount) config._retryCount = 0;\n\n // stop retry if max reached\n if (config._retryCount >= this.maxRetries) {\n throw error;\n }\n\n config._retryCount++;\n\n // exponential delay: delay * 2^(retryCount)\n const delay =\n this.retryDelay * Math.pow(2, config._retryCount);\n\n await new Promise(resolve => setTimeout(resolve, delay));\n\n return this.client(config);\n }\n );\n }\n post<T = any>(url: string, data: any, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .post<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n patch<T = any>(\n url: string,\n data: any,\n extraHeaders: Record<string, string> = {}\n ): Promise<T> {\n return this.client\n .patch<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n get<T = any>(url: string, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .get<T>(url, { headers: extraHeaders })\n .then((res) => res.data);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateJwtPayload,\n CreateJwtResponse,\n} from \"../types/auth.types\";\nimport { ulid } from \"ulid\";\n\nexport class AuthAPI {\n constructor(\n private http: HttpClient,\n private partnerId: string,\n private apiKey: string\n\n ) { }\n\n createJwtToken(payload: CreateJwtPayload): Promise<CreateJwtResponse> {\n let fullPayload = {\n ...payload,\n partner_id: this.partnerId,\n api_key: this.apiKey,\n };\n\n\n\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n\n createJwtTokenForPublic(): Promise<CreateJwtResponse> {\n let userid = `public_user_${ulid()}@morambacrypto.moramba.io`;\n let fullPayload = {\n userid: userid,\n partner_id: this.partnerId,\n };\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateCompanyPayload,\n CreateCompanyResponse,\n UpdateCompanyEmailPayload,\n UpdateCompanyEmailResponse,\n GetCompaniesQuery,\n GetCompaniesResponse,\n UpdateCompanyPaymentPayload,\n UpdateCompanyPaymentResponse,\n} from \"../types/company.types\";\n\nexport class CompanyAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n createCompany(payload: CreateCompanyPayload, jwtToken: string): Promise<CreateCompanyResponse> {\n\n return this.http.post(\n \"/morambacrypto/create/company\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyEmail(\n payload: UpdateCompanyEmailPayload,\n jwtToken: string\n ): Promise<UpdateCompanyEmailResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getCompaniesByPartner(\n jwtToken: string,\n query: GetCompaniesQuery\n ): Promise<GetCompaniesResponse> {\n const params = new URLSearchParams();\n\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.direction) params.append(\"direction\", query.direction);\n if (query.cursor) params.append(\"cursor\", query.cursor);\n\n return this.http.get(\n `/morambacrypto/companies/partner/${query.partner_id}?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyPaymentMethod(\n payload: UpdateCompanyPaymentPayload,\n jwtToken: string\n ): Promise<UpdateCompanyPaymentResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreateMerchantPayload, CreateMerchantResponse, GetMerchantListResponse, GetMerchantQuery, GetMerchantResponse, MerchantListQuery, UpdateMerchantEmailPayload, UpdateMerchantEmailResponse, UpdateMerchantPaymentPayload, UpdateMerchantPaymentResponse } from \"../types/merchant.types\";\n\nexport class MerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createMerchant(payload: CreateMerchantPayload, jwtToken: string): Promise<CreateMerchantResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/merchant\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantPaymentMethod(\n payload: UpdateMerchantPaymentPayload,\n jwtToken: string\n ): Promise<UpdateMerchantPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantEmail(\n payload: UpdateMerchantEmailPayload,\n jwtToken: string\n ): Promise<UpdateMerchantEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getMerchantList(\n jwtToken: string,\n query: MerchantListQuery = {}\n ): Promise<GetMerchantListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/merchants/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleMerchant(\n jwtToken: string,\n query: GetMerchantQuery = {}\n ): Promise<GetMerchantResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/merchants?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreateUserPayload, CreateUserResponse, GetUserListResponse, GetUserQuery, GetUserResponse, UpdateUserEmailPayload, UpdateUserEmailResponse, UpdateUserPaymentPayload, UpdateUserPaymentResponse, UserListQuery } from \"../types/user.types\";\n\nexport class UserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createUser(payload: CreateUserPayload, jwtToken: string): Promise<CreateUserResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/user\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserPaymentMethod(\n payload: UpdateUserPaymentPayload,\n jwtToken: string\n ): Promise<UpdateUserPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserEmail(\n payload: UpdateUserEmailPayload,\n jwtToken: string\n ): Promise<UpdateUserEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getUserList(\n jwtToken: string,\n query: UserListQuery = {}\n ): Promise<GetUserListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/users/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleUser(\n jwtToken: string,\n query: GetUserQuery = {}\n ): Promise<GetUserResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/users?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationUser, GetAPayoutDestinationUser, PayoutDestinationUserResponse } from \"../types/payout_destination_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayoutDestinationUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationUser(payload: CreatePayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationUser(payload: GetAPayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/for/${payload.user_type as UserType}/details?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayinUser, GetPayinUser, PayinUserResponse } from \"../types/payin_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayinUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayinUser(payload: CreatePayinUser, jwtToken: string): Promise<PayinUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payin/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayinUser(payload: GetPayinUser, jwtToken: string): Promise<PayinUserResponse> {\n return this.http.get(\n `/morambacrypto/payin/for/${payload.user_type as UserType}/details?payin_id=${payload.payin_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { InitTransaction, PayTransaction, TransactionInitResponse, TransactionPayResponse } from \"../types\";\nexport class PayAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n initPayment(payload: InitTransaction, jwtToken: string): Promise<TransactionInitResponse> {\n return this.http.get(\n `/morambacrypto/payrequest/init/${payload.payin_id}/nt/monad/address/${payload.address}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n Pay(payload: PayTransaction, jwtToken: string): Promise<TransactionPayResponse> {\n return this.http.post(\n `/morambacrypto/payrequest/pay/${payload.payin_id}/nt/monad/tnxid/${payload.transaction_id}/relay`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationMerchant, GetAPayoutDestinationMerchant, PayoutDestinationMerchantResponse } from \"../types/payout_destination_merchant.types\";\n\nexport class PayoutDestinationMerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationMerchant(payload: CreatePayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/merchant`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationMerchant(payload: GetAPayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/merchant?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { FindPayoutDestination, PayoutDestinationResponse } from \"../types/payout_destination.types\";\n\nexport class PayoutDestinationAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n getPayoutDestination(payload: FindPayoutDestination, jwtToken: string): Promise<PayoutDestinationResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/check/both/by-id?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"./client/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinUserAPI, PayoutDestinationAPI, PayoutDestinationUserAPI } from \"./apis\";\nimport { PayoutDestinationMerchantAPI } from \"./apis/payout_destination_merchant.api\";\n\nexport interface MorambaClientConfig {\n baseURL: string;\n apiKey: string;\n partnerId: string;\n}\n\nexport class MorambaClient {\n public auth: AuthAPI;\n private http: HttpClient;\n public company: CompanyAPI;\n public merchant: MerchantAPI;\n public user: UserAPI;\n public payoutDestinationUser: PayoutDestinationUserAPI;\n public payinUser: PayinUserAPI;\n public pay: PayAPI;\n public payoutDestinationMerchant: PayoutDestinationMerchantAPI;\n public payoutDestination: PayoutDestinationAPI;\n\n\n constructor(config: MorambaClientConfig) {\n this.http = new HttpClient(config.baseURL, {\n \"Content-Type\": \"application/json\",\n });\n\n this.auth = new AuthAPI(this.http, config.partnerId, config.apiKey);\n this.company = new CompanyAPI(this.http);\n this.merchant = new MerchantAPI(this.http);\n this.user = new UserAPI(this.http);\n this.payoutDestinationUser = new PayoutDestinationUserAPI(this.http);\n this.payinUser = new PayinUserAPI(this.http);\n this.pay = new PayAPI(this.http);\n this.payoutDestinationMerchant = new PayoutDestinationMerchantAPI(this.http);\n this.payoutDestination = new PayoutDestinationAPI(this.http);\n }\n}\n","import { PaymentMethod } from \"./payment_method.types\";\n\nexport enum UserType {\n CUSTOMER = \"customer\",\n VENDOR = \"vendor\",\n AI_AGENT = \"AI_agent\",\n DEVICE = \"device\",\n OTHER = \"other\",\n}\nexport interface CreateUserPayload {\n payment_method: PaymentMethod;\n user_name: string;\n user_email: string;\n user_type: UserType;\n company_id: string;\n merchant_id: string;\n}\n\nexport interface UserData {\n id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n company_id: string;\n partner_id: string;\n user_type: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CreateUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\nexport interface UpdateUserPaymentPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n payment_method: PaymentMethod;\n}\nexport interface UpdateUserPaymentResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UpdateUserEmailPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n email: string;\n}\n\nexport interface UpdateUserEmailResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UserListQuery {\n company_id?: string;\n limit?: number;\n cursor?: string;\n forward?: string;\n backward?: string;\n}\n\nexport interface UserListData {\n id: string;\n company_id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n partner_id: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n\n}\nexport interface GetUserListResponse {\n forward_cursor: string;\n backward_cursor: string;\n has_forward: boolean;\n has_backward: boolean;\n data: UserListData | null;\n}\n\nexport interface GetUserQuery {\n merchant_id?: string;\n}\n\nexport interface GetUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}","\nimport { ethers } from \"ethers\";\nimport { MONAD_CONFIG } from \"../utils/networks\";\n\nexport interface MonadApproveOptions {\n privateKey: string;\n unlimited?: boolean; // default: true\n amount?: string; // user-specified amount when limited\n decimalsOverride?: number; // optional override\n}\n\nexport async function monadApprove(options: MonadApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = MONAD_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Monad approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n","\nexport interface TokenNetworkConfig {\n rpc: string;\n spender: string;\n token: string;\n decimals: number;\n defaultAmount: string;\n}\n\n// ▶️ MORAMBA Token (Monad)\nexport const MONAD_CONFIG: TokenNetworkConfig = {\n rpc: \"https://testnet-rpc.monad.xyz\",\n spender: \"0x778501615Dfd26e42e58b233325ebE352f848F01\",\n token: \"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n\n// ▶️ Sepolia \nexport const SEPOLIA_CONFIG: TokenNetworkConfig = {\n rpc: \"https://rpc.sepolia.org\",\n spender: \"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab\",\n token: \"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n","import { ethers } from \"ethers\";\nimport { SEPOLIA_CONFIG } from \"../utils/networks\";\n\nexport interface SepoliaApproveOptions {\n privateKey: string;\n unlimited?: boolean;\n amount?: string;\n decimalsOverride?: number;\n}\n\nexport async function sepoliaApprove(options: SepoliaApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = SEPOLIA_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Sepolia approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n"],"mappings":"AAAA,OAAOA,MAA0C,QAE1C,IAAMC,EAAN,KAAiB,CAKpB,YACIC,EACAC,EAAkC,CAAC,EACnCC,EAAa,EACbC,EAAa,IACf,CACE,KAAK,OAASL,EAAM,OAAO,CACvB,QAAAE,EACA,QAAAC,EACA,QAAS,GACb,CAAC,EAED,KAAK,WAAaC,EAClB,KAAK,WAAaC,EAElB,KAAK,sBAAsB,CAC/B,CAEA,IAAI,eAA+B,CAC/B,OAAO,KAAK,MAChB,CAEQ,uBAAwB,CAC5B,KAAK,OAAO,aAAa,SAAS,IAC9BC,GAAYA,EACZ,MAAOC,GAAsB,CAhCzC,IAAAC,EAiCgB,IAAMC,EAAcF,EAAM,OAE1B,GAAI,CAACE,EAAQ,MAAMF,EACnB,IAAMG,GAASF,EAAAD,EAAM,WAAN,YAAAC,EAAgB,OAW/B,GARIE,GAAUA,GAAU,KAAOA,EAAS,KAAOA,IAAW,MAKrDD,EAAO,cAAaA,EAAO,YAAc,GAG1CA,EAAO,aAAe,KAAK,YAC3B,MAAMF,EAGVE,EAAO,cAGP,IAAME,EACF,KAAK,WAAa,KAAK,IAAI,EAAGF,EAAO,WAAW,EAEpD,aAAM,IAAI,QA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BC,GAAeC,EAAgC,CACjE,GAAM,CACF,WAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EACA,iBAAAC,CACJ,EAAIJ,EAEEK,EAAMC,EAENC,EAAW,IAAIC,EAAO,gBAAgBH,EAAI,GAAG,EAC7CI,EAAS,IAAID,EAAO,OAAOP,EAAYM,CAAQ,EAE/CG,EAAM,CACR,0EACJ,EAEMC,EAAW,IAAIH,EAAO,SAASH,EAAI,MAAOK,EAAKD,CAAM,EAErDG,EAAWR,GAAA,KAAAA,EAAoBC,EAAI,SACnCQ,EAAcV,GAAA,KAAAA,EAAUE,EAAI,cAE5BS,EAAQZ,EACRM,EAAO,WACPA,EAAO,WAAWK,EAAaD,CAAQ,EAE7C,QAAQ,IAAI,0BAAqB,EACjC,QAAQ,IAAI,OAAQP,EAAI,GAAG,EAC3B,QAAQ,IAAI,SAAUA,EAAI,KAAK,EAC/B,QAAQ,IAAI,WAAYA,EAAI,OAAO,EACnC,QAAQ,IAAI,YAAaO,CAAQ,EACjC,QAAQ,IAAI,UAAWV,EAAY,YAAcW,CAAW,EAC5D,QAAQ,IAAI,QAAS,MAAMJ,EAAO,WAAW,CAAC,EAE9C,IAAMM,EAAK,MAAMJ,EAAS,QAAQN,EAAI,QAASS,CAAK,EACpD,QAAQ,IAAI,gBAAUC,EAAG,IAAI,EAE7B,IAAMC,EAAU,MAAMD,EAAG,KAAK,EAC9B,eAAQ,IAAI,gBAAYC,EAAQ,WAAW,EAEpC,CAAE,KAAMD,EAAG,KAAM,QAAAC,CAAQ,CACpC","names":["axios","HttpClient","baseURL","headers","maxRetries","retryDelay","response","error","_a","config","status","delay","resolve","url","data","extraHeaders","res","ulid","AuthAPI","http","partnerId","apiKey","payload","fullPayload","CompanyAPI","http","payload","jwtToken","query","params","MerchantAPI","http","payload","jwtToken","query","params","UserAPI","http","payload","jwtToken","query","params","PayoutDestinationUserAPI","http","payload","jwtToken","PayinUserAPI","http","payload","jwtToken","PayAPI","http","payload","jwtToken","PayoutDestinationMerchantAPI","http","payload","jwtToken","PayoutDestinationAPI","http","payload","jwtToken","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","UserType","ethers","MONAD_CONFIG","SEPOLIA_CONFIG","monadApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","MONAD_CONFIG","provider","ethers","wallet","abi","contract","decimals","humanAmount","value","tx","receipt","ethers","sepoliaApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","SEPOLIA_CONFIG","provider","ethers","wallet","abi","contract","decimals","humanAmount","value","tx","receipt"]}
|
|
1
|
+
{"version":3,"sources":["../src/client/HttpClient.ts","../src/apis/auth.api.ts","../src/apis/company.api.ts","../src/apis/merchant.api.ts","../src/apis/user.api.ts","../src/apis/payout_destination_user.api.ts","../src/apis/payin_user.api.ts","../src/apis/pay.api.ts","../src/apis/payout_destination_merchant.api.ts","../src/apis/payout_destination.api.ts","../src/apis/payin_button.api.ts","../src/MorambaClient.ts","../src/types/user.types.ts","../src/authorize/monad.approve.ts","../src/utils/networks.ts","../src/authorize/sepolia.approve.ts"],"sourcesContent":["import axios, { AxiosInstance, AxiosError } from \"axios\";\n\nexport class HttpClient {\n private client: AxiosInstance;\n private maxRetries: number;\n private retryDelay: number; // base delay in milliseconds\n\n constructor(\n baseURL: string,\n headers: Record<string, string> = {},\n maxRetries = 4, // default: 4 retries\n retryDelay = 300 // base delay: 300ms\n ) {\n this.client = axios.create({\n baseURL,\n headers,\n timeout: 10000,\n });\n\n this.maxRetries = maxRetries;\n this.retryDelay = retryDelay;\n\n this.setupRetryInterceptor();\n }\n\n get axiosInstance(): AxiosInstance {\n return this.client;\n }\n\n private setupRetryInterceptor() {\n this.client.interceptors.response.use(\n response => response,\n async (error: AxiosError) => {\n const config: any = error.config;\n\n if (!config) throw error;\n const status = error.response?.status;\n\n // ✅ Do NOT retry on 400 Bad Request\n if (status && status >= 400 && status < 500 && status !== 429) {\n throw error;\n }\n\n // initialize retry counter\n if (!config._retryCount) config._retryCount = 0;\n\n // stop retry if max reached\n if (config._retryCount >= this.maxRetries) {\n throw error;\n }\n\n config._retryCount++;\n\n // exponential delay: delay * 2^(retryCount)\n const delay =\n this.retryDelay * Math.pow(2, config._retryCount);\n\n await new Promise(resolve => setTimeout(resolve, delay));\n\n return this.client(config);\n }\n );\n }\n post<T = any>(url: string, data: any, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .post<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n patch<T = any>(\n url: string,\n data: any,\n extraHeaders: Record<string, string> = {}\n ): Promise<T> {\n return this.client\n .patch<T>(url, data, { headers: extraHeaders })\n .then((res) => res.data);\n }\n get<T = any>(url: string, extraHeaders: Record<string, string> = {}): Promise<T> {\n return this.client\n .get<T>(url, { headers: extraHeaders })\n .then((res) => res.data);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateJwtPayload,\n CreateJwtResponse,\n} from \"../types/auth.types\";\nimport { ulid } from \"ulid\";\n\nexport class AuthAPI {\n constructor(\n private http: HttpClient,\n private partnerId: string,\n private apiKey: string\n\n ) { }\n\n createJwtToken(payload: CreateJwtPayload): Promise<CreateJwtResponse> {\n let fullPayload = {\n ...payload,\n partner_id: this.partnerId,\n api_key: this.apiKey,\n };\n\n\n\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n\n createJwtTokenForPublic(): Promise<CreateJwtResponse> {\n let userid = `public_user_${ulid()}@morambacrypto.moramba.io`;\n let fullPayload = {\n userid: userid,\n partner_id: this.partnerId,\n };\n return this.http.post(\"/morambacrypto/create/jwt_token\", fullPayload);\n }\n}\n","import { HttpClient } from \"../client/HttpClient\";\nimport {\n CreateCompanyPayload,\n CreateCompanyResponse,\n UpdateCompanyEmailPayload,\n UpdateCompanyEmailResponse,\n GetCompaniesQuery,\n GetCompaniesResponse,\n UpdateCompanyPaymentPayload,\n UpdateCompanyPaymentResponse,\n} from \"../types/company.types\";\n\nexport class CompanyAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n createCompany(payload: CreateCompanyPayload, jwtToken: string): Promise<CreateCompanyResponse> {\n\n return this.http.post(\n \"/morambacrypto/create/company\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyEmail(\n payload: UpdateCompanyEmailPayload,\n jwtToken: string\n ): Promise<UpdateCompanyEmailResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getCompaniesByPartner(\n jwtToken: string,\n query: GetCompaniesQuery\n ): Promise<GetCompaniesResponse> {\n const params = new URLSearchParams();\n\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.direction) params.append(\"direction\", query.direction);\n if (query.cursor) params.append(\"cursor\", query.cursor);\n\n return this.http.get(\n `/morambacrypto/companies/partner/${query.partner_id}?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateCompanyPaymentMethod(\n payload: UpdateCompanyPaymentPayload,\n jwtToken: string\n ): Promise<UpdateCompanyPaymentResponse> {\n return this.http.patch(\n \"/morambacrypto/update/company/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreateMerchantPayload, CreateMerchantResponse, GetMerchantListResponse, GetMerchantQuery, GetMerchantResponse, MerchantListQuery, UpdateMerchantEmailPayload, UpdateMerchantEmailResponse, UpdateMerchantPaymentPayload, UpdateMerchantPaymentResponse } from \"../types/merchant.types\";\n\nexport class MerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createMerchant(payload: CreateMerchantPayload, jwtToken: string): Promise<CreateMerchantResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/merchant\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantPaymentMethod(\n payload: UpdateMerchantPaymentPayload,\n jwtToken: string\n ): Promise<UpdateMerchantPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateMerchantEmail(\n payload: UpdateMerchantEmailPayload,\n jwtToken: string\n ): Promise<UpdateMerchantEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/merchant/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getMerchantList(\n jwtToken: string,\n query: MerchantListQuery = {}\n ): Promise<GetMerchantListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/merchants/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleMerchant(\n jwtToken: string,\n query: GetMerchantQuery = {}\n ): Promise<GetMerchantResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/merchants?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreateUserPayload, CreateUserResponse, GetUserListResponse, GetUserQuery, GetUserResponse, UpdateUserEmailPayload, UpdateUserEmailResponse, UpdateUserPaymentPayload, UpdateUserPaymentResponse, UserListQuery } from \"../types/user.types\";\n\nexport class UserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createUser(payload: CreateUserPayload, jwtToken: string): Promise<CreateUserResponse> {\n\n\n return this.http.post(\n \"/morambacrypto/create/user\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserPaymentMethod(\n payload: UpdateUserPaymentPayload,\n jwtToken: string\n ): Promise<UpdateUserPaymentResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/payment\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n updateUserEmail(\n payload: UpdateUserEmailPayload,\n jwtToken: string\n ): Promise<UpdateUserEmailResponse> {\n\n\n return this.http.patch(\n \"/morambacrypto/update/user/email\",\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n\n getUserList(\n jwtToken: string,\n query: UserListQuery = {}\n ): Promise<GetUserListResponse> {\n const params = new URLSearchParams();\n if (query.company_id) params.append(\"company_id\", String(query.company_id));\n if (query.limit) params.append(\"limit\", String(query.limit));\n if (query.cursor) params.append(\"cursor\", query.cursor);\n if (query.forward) params.append(\"cursor\", query.forward);\n if (query.backward) params.append(\"cursor\", query.backward);\n\n\n return this.http.get(\n `/morambacrypto/users/all?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getSingleUser(\n jwtToken: string,\n query: GetUserQuery = {}\n ): Promise<GetUserResponse> {\n const params = new URLSearchParams();\n if (query.merchant_id) params.append(\"merchant_id\", String(query.merchant_id));\n\n\n return this.http.get(\n `/morambacrypto/users?${params.toString()}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n}","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationUser, GetAPayoutDestinationUser, PayoutDestinationUserResponse } from \"../types/payout_destination_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayoutDestinationUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationUser(payload: CreatePayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationUser(payload: GetAPayoutDestinationUser, jwtToken: string): Promise<PayoutDestinationUserResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/for/${payload.user_type as UserType}/details?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayinUser, GetPayinUser, PayinUserResponse } from \"../types/payin_user.types\";\nimport { UserType } from \"../types/user.types\";\nexport class PayinUserAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayinUser(payload: CreatePayinUser, jwtToken: string): Promise<PayinUserResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payin/for/${payload.user_type as UserType}`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayinUser(payload: GetPayinUser, jwtToken: string): Promise<PayinUserResponse> {\n return this.http.get(\n `/morambacrypto/payin/for/${payload.user_type as UserType}/details?payin_id=${payload.payin_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { InitTransaction, PayTransaction, TransactionInitResponse, TransactionPayResponse } from \"../types\";\nexport class PayAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n initPayment(payload: InitTransaction, jwtToken: string): Promise<TransactionInitResponse> {\n return this.http.get(\n `/morambacrypto/payrequest/init/${payload.payin_id}/nt/monad/address/${payload.address}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n Pay(payload: PayTransaction, jwtToken: string): Promise<TransactionPayResponse> {\n return this.http.post(\n `/morambacrypto/payrequest/pay/${payload.payin_id}/nt/monad/tnxid/${payload.transaction_id}/relay`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayoutDestinationMerchant, GetAPayoutDestinationMerchant, PayoutDestinationMerchantResponse } from \"../types/payout_destination_merchant.types\";\n\nexport class PayoutDestinationMerchantAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayoutDestinationMerchant(payload: CreatePayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n\n\n return this.http.post(\n `/morambacrypto/create/payout-destination/merchant`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayoutDestinationMerchant(payload: GetAPayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/merchant?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { FindPayoutDestination, PayoutDestinationResponse } from \"../types/payout_destination.types\";\n\nexport class PayoutDestinationAPI {\n constructor(\n private http: HttpClient\n ) { }\n\n getPayoutDestination(payload: FindPayoutDestination, jwtToken: string): Promise<PayoutDestinationResponse> {\n return this.http.get(\n `/morambacrypto/payout-destination/check/both/by-id?payout_destination_id=${payload.payout_destination_id}`,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"../client\";\nimport { CreatePayinButtonRequestDto } from \"../types/payin_button.types\";\nimport { PayinUserResponse } from \"../types/payin_user.types\";\nexport class PayinButtonAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayinButton(payload: CreatePayinButtonRequestDto, jwtToken: string): Promise<PayinUserResponse> {\n\n return this.http.post(\n `/morambacrypto/payin/create/button`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n}\n","import { HttpClient } from \"./client/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinButtonAPI, PayinUserAPI, PayoutDestinationAPI, PayoutDestinationUserAPI } from \"./apis\";\nimport { PayoutDestinationMerchantAPI } from \"./apis/payout_destination_merchant.api\";\n\nexport interface MorambaClientConfig {\n baseURL: string;\n apiKey: string;\n partnerId: string;\n}\n\nexport class MorambaClient {\n public auth: AuthAPI;\n private http: HttpClient;\n public company: CompanyAPI;\n public merchant: MerchantAPI;\n public user: UserAPI;\n public payoutDestinationUser: PayoutDestinationUserAPI;\n public payinUser: PayinUserAPI;\n public pay: PayAPI;\n public payoutDestinationMerchant: PayoutDestinationMerchantAPI;\n public payoutDestination: PayoutDestinationAPI;\n public payinButton: PayinButtonAPI;\n\n\n constructor(config: MorambaClientConfig) {\n this.http = new HttpClient(config.baseURL, {\n \"Content-Type\": \"application/json\",\n });\n\n this.auth = new AuthAPI(this.http, config.partnerId, config.apiKey);\n this.company = new CompanyAPI(this.http);\n this.merchant = new MerchantAPI(this.http);\n this.user = new UserAPI(this.http);\n this.payoutDestinationUser = new PayoutDestinationUserAPI(this.http);\n this.payinUser = new PayinUserAPI(this.http);\n this.pay = new PayAPI(this.http);\n this.payoutDestinationMerchant = new PayoutDestinationMerchantAPI(this.http);\n this.payoutDestination = new PayoutDestinationAPI(this.http);\n this.payinButton = new PayinButtonAPI(this.http);\n }\n}\n","import { PaymentMethod } from \"./payment_method.types\";\n\nexport enum UserType {\n CUSTOMER = \"customer\",\n VENDOR = \"vendor\",\n AI_AGENT = \"AI_agent\",\n DEVICE = \"device\",\n OTHER = \"other\",\n}\nexport interface CreateUserPayload {\n payment_method: PaymentMethod;\n user_name: string;\n user_email: string;\n user_type: UserType;\n company_id: string;\n merchant_id: string;\n}\n\nexport interface UserData {\n id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n company_id: string;\n partner_id: string;\n user_type: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CreateUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\nexport interface UpdateUserPaymentPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n payment_method: PaymentMethod;\n}\nexport interface UpdateUserPaymentResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UpdateUserEmailPayload {\n company_id: string;\n merchant_id: string;\n user_id: string;\n email: string;\n}\n\nexport interface UpdateUserEmailResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}\n\n\nexport interface UserListQuery {\n company_id?: string;\n limit?: number;\n cursor?: string;\n forward?: string;\n backward?: string;\n}\n\nexport interface UserListData {\n id: string;\n company_id: string;\n merchant_id: string;\n user_name: string;\n user_email: string;\n partner_id: string;\n payment_network: string;\n payment_token_name: string;\n payment_token_address: string;\n created_at: string;\n updated_at: string;\n\n}\nexport interface GetUserListResponse {\n forward_cursor: string;\n backward_cursor: string;\n has_forward: boolean;\n has_backward: boolean;\n data: UserListData | null;\n}\n\nexport interface GetUserQuery {\n merchant_id?: string;\n}\n\nexport interface GetUserResponse {\n success: boolean;\n message: string;\n data: UserData | null;\n}","\nimport { ethers } from \"ethers\";\nimport { MONAD_CONFIG } from \"../utils/networks\";\n\nexport interface MonadApproveOptions {\n privateKey: string;\n unlimited?: boolean; // default: true\n amount?: string; // user-specified amount when limited\n decimalsOverride?: number; // optional override\n}\n\nexport async function monadApprove(options: MonadApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = MONAD_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Monad approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n","\nexport interface TokenNetworkConfig {\n rpc: string;\n spender: string;\n token: string;\n decimals: number;\n defaultAmount: string;\n}\n\n// ▶️ MORAMBA Token (Monad)\nexport const MONAD_CONFIG: TokenNetworkConfig = {\n rpc: \"https://testnet-rpc.monad.xyz\",\n spender: \"0x778501615Dfd26e42e58b233325ebE352f848F01\",\n token: \"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n\n// ▶️ Sepolia \nexport const SEPOLIA_CONFIG: TokenNetworkConfig = {\n rpc: \"https://rpc.sepolia.org\",\n spender: \"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab\",\n token: \"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C\",\n decimals: 6,\n defaultAmount: \"1000\",\n};\n","import { ethers } from \"ethers\";\nimport { SEPOLIA_CONFIG } from \"../utils/networks\";\n\nexport interface SepoliaApproveOptions {\n privateKey: string;\n unlimited?: boolean;\n amount?: string;\n decimalsOverride?: number;\n}\n\nexport async function sepoliaApprove(options: SepoliaApproveOptions) {\n const {\n privateKey,\n unlimited = true,\n amount,\n decimalsOverride,\n } = options;\n\n const cfg = SEPOLIA_CONFIG;\n\n const provider = new ethers.JsonRpcProvider(cfg.rpc);\n const wallet = new ethers.Wallet(privateKey, provider);\n\n const abi = [\n \"function approve(address spender, uint256 value) external returns (bool)\"\n ];\n\n const contract = new ethers.Contract(cfg.token, abi, wallet);\n\n const decimals = decimalsOverride ?? cfg.decimals;\n const humanAmount = amount ?? cfg.defaultAmount;\n\n const value = unlimited\n ? ethers.MaxUint256\n : ethers.parseUnits(humanAmount, decimals);\n\n console.log(\"⚡ Sepolia approve()\");\n console.log(\"RPC:\", cfg.rpc);\n console.log(\"Token:\", cfg.token);\n console.log(\"Spender:\", cfg.spender);\n console.log(\"Decimals:\", decimals);\n console.log(\"Amount:\", unlimited ? \"UNLIMITED\" : humanAmount);\n console.log(\"From:\", await wallet.getAddress());\n\n const tx = await contract.approve(cfg.spender, value);\n console.log(\"📤 TX:\", tx.hash);\n\n const receipt = await tx.wait();\n console.log(\"✅ Block:\", receipt.blockNumber);\n\n return { hash: tx.hash, receipt };\n}\n"],"mappings":"AAAA,OAAOA,MAA0C,QAE1C,IAAMC,EAAN,KAAiB,CAKpB,YACIC,EACAC,EAAkC,CAAC,EACnCC,EAAa,EACbC,EAAa,IACf,CACE,KAAK,OAASL,EAAM,OAAO,CACvB,QAAAE,EACA,QAAAC,EACA,QAAS,GACb,CAAC,EAED,KAAK,WAAaC,EAClB,KAAK,WAAaC,EAElB,KAAK,sBAAsB,CAC/B,CAEA,IAAI,eAA+B,CAC/B,OAAO,KAAK,MAChB,CAEQ,uBAAwB,CAC5B,KAAK,OAAO,aAAa,SAAS,IAC9BC,GAAYA,EACZ,MAAOC,GAAsB,CAhCzC,IAAAC,EAiCgB,IAAMC,EAAcF,EAAM,OAE1B,GAAI,CAACE,EAAQ,MAAMF,EACnB,IAAMG,GAASF,EAAAD,EAAM,WAAN,YAAAC,EAAgB,OAW/B,GARIE,GAAUA,GAAU,KAAOA,EAAS,KAAOA,IAAW,MAKrDD,EAAO,cAAaA,EAAO,YAAc,GAG1CA,EAAO,aAAe,KAAK,YAC3B,MAAMF,EAGVE,EAAO,cAGP,IAAME,EACF,KAAK,WAAa,KAAK,IAAI,EAAGF,EAAO,WAAW,EAEpD,aAAM,IAAI,QAAQG,GAAW,WAAWA,EAASD,CAAK,CAAC,EAEhD,KAAK,OAAOF,CAAM,CAC7B,CACJ,CACJ,CACA,KAAcI,EAAaC,EAAWC,EAAuC,CAAC,EAAe,CACzF,OAAO,KAAK,OACP,KAAQF,EAAKC,EAAM,CAAE,QAASC,CAAa,CAAC,EAC5C,KAAMC,GAAQA,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AUvB,eAAsBC,GAAeC,EAAgC,CACjE,GAAM,CACF,WAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EACA,iBAAAC,CACJ,EAAIJ,EAEEK,EAAMC,EAENC,EAAW,IAAIC,EAAO,gBAAgBH,EAAI,GAAG,EAC7CI,EAAS,IAAID,EAAO,OAAOP,EAAYM,CAAQ,EAE/CG,EAAM,CACR,0EACJ,EAEMC,EAAW,IAAIH,EAAO,SAASH,EAAI,MAAOK,EAAKD,CAAM,EAErDG,EAAWR,GAAA,KAAAA,EAAoBC,EAAI,SACnCQ,EAAcV,GAAA,KAAAA,EAAUE,EAAI,cAE5BS,EAAQZ,EACRM,EAAO,WACPA,EAAO,WAAWK,EAAaD,CAAQ,EAE7C,QAAQ,IAAI,0BAAqB,EACjC,QAAQ,IAAI,OAAQP,EAAI,GAAG,EAC3B,QAAQ,IAAI,SAAUA,EAAI,KAAK,EAC/B,QAAQ,IAAI,WAAYA,EAAI,OAAO,EACnC,QAAQ,IAAI,YAAaO,CAAQ,EACjC,QAAQ,IAAI,UAAWV,EAAY,YAAcW,CAAW,EAC5D,QAAQ,IAAI,QAAS,MAAMJ,EAAO,WAAW,CAAC,EAE9C,IAAMM,EAAK,MAAMJ,EAAS,QAAQN,EAAI,QAASS,CAAK,EACpD,QAAQ,IAAI,gBAAUC,EAAG,IAAI,EAE7B,IAAMC,EAAU,MAAMD,EAAG,KAAK,EAC9B,eAAQ,IAAI,gBAAYC,EAAQ,WAAW,EAEpC,CAAE,KAAMD,EAAG,KAAM,QAAAC,CAAQ,CACpC","names":["axios","HttpClient","baseURL","headers","maxRetries","retryDelay","response","error","_a","config","status","delay","resolve","url","data","extraHeaders","res","ulid","AuthAPI","http","partnerId","apiKey","payload","fullPayload","CompanyAPI","http","payload","jwtToken","query","params","MerchantAPI","http","payload","jwtToken","query","params","UserAPI","http","payload","jwtToken","query","params","PayoutDestinationUserAPI","http","payload","jwtToken","PayinUserAPI","http","payload","jwtToken","PayAPI","http","payload","jwtToken","PayoutDestinationMerchantAPI","http","payload","jwtToken","PayoutDestinationAPI","http","payload","jwtToken","PayinButtonAPI","http","payload","jwtToken","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","PayinButtonAPI","UserType","ethers","MONAD_CONFIG","SEPOLIA_CONFIG","monadApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","MONAD_CONFIG","provider","ethers","wallet","abi","contract","decimals","humanAmount","value","tx","receipt","ethers","sepoliaApprove","options","privateKey","unlimited","amount","decimalsOverride","cfg","SEPOLIA_CONFIG","provider","ethers","wallet","abi","contract","decimals","humanAmount","value","tx","receipt"]}
|