@morambacrypto/connect 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
File without changes
package/dist/index.d.mts CHANGED
@@ -562,6 +562,11 @@ interface PayButtonPublicConsumeReqDto {
562
562
  payin_id: string;
563
563
  }
564
564
  interface PayButtonResponse {
565
+ success: boolean;
566
+ message: string;
567
+ data: PayButtonData;
568
+ }
569
+ interface PayButtonData {
565
570
  id: string;
566
571
  company_id: string;
567
572
  partner_id: string;
@@ -597,6 +602,14 @@ interface PayButtonResponse {
597
602
  payout_destination_id: string;
598
603
  user_id: string;
599
604
  }
605
+ interface UpdatePayButtonStatusDtos {
606
+ pay_button_id: string;
607
+ }
608
+ interface CursorQuery {
609
+ limit?: number;
610
+ forward?: string | null;
611
+ backward?: string | null;
612
+ }
600
613
 
601
614
  declare class PayAPI {
602
615
  private http;
@@ -628,6 +641,9 @@ declare class PayButtonAPI {
628
641
  private http;
629
642
  constructor(http: HttpClient);
630
643
  createPayButton(payload: CreatePayButtonRequestDto, jwtToken: string): Promise<PayButtonResponse>;
644
+ activatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse>;
645
+ deactivatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse>;
646
+ getPayButtonList(jwtToken: string, query?: CursorQuery): Promise<PayButtonResponse>;
631
647
  }
632
648
 
633
649
  interface MorambaClientConfig {
@@ -673,4 +689,4 @@ declare function sepoliaApprove(options: SepoliaApproveOptions): Promise<{
673
689
  receipt: any;
674
690
  }>;
675
691
 
676
- export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayButtonRequestDto, 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 PayButtonPublicConsumeReqDto, type PayButtonPublicResponseDto, type PayButtonResponse, 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 UpdatePayButtonStatusDto, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
692
+ export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayButtonRequestDto, type CreatePayinButtonRequestDto, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type CursorQuery, 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 PayButtonData, type PayButtonPublicConsumeReqDto, type PayButtonPublicResponseDto, type PayButtonResponse, 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 UpdatePayButtonStatusDto, type UpdatePayButtonStatusDtos, 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
@@ -562,6 +562,11 @@ interface PayButtonPublicConsumeReqDto {
562
562
  payin_id: string;
563
563
  }
564
564
  interface PayButtonResponse {
565
+ success: boolean;
566
+ message: string;
567
+ data: PayButtonData;
568
+ }
569
+ interface PayButtonData {
565
570
  id: string;
566
571
  company_id: string;
567
572
  partner_id: string;
@@ -597,6 +602,14 @@ interface PayButtonResponse {
597
602
  payout_destination_id: string;
598
603
  user_id: string;
599
604
  }
605
+ interface UpdatePayButtonStatusDtos {
606
+ pay_button_id: string;
607
+ }
608
+ interface CursorQuery {
609
+ limit?: number;
610
+ forward?: string | null;
611
+ backward?: string | null;
612
+ }
600
613
 
601
614
  declare class PayAPI {
602
615
  private http;
@@ -628,6 +641,9 @@ declare class PayButtonAPI {
628
641
  private http;
629
642
  constructor(http: HttpClient);
630
643
  createPayButton(payload: CreatePayButtonRequestDto, jwtToken: string): Promise<PayButtonResponse>;
644
+ activatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse>;
645
+ deactivatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse>;
646
+ getPayButtonList(jwtToken: string, query?: CursorQuery): Promise<PayButtonResponse>;
631
647
  }
632
648
 
633
649
  interface MorambaClientConfig {
@@ -673,4 +689,4 @@ declare function sepoliaApprove(options: SepoliaApproveOptions): Promise<{
673
689
  receipt: any;
674
690
  }>;
675
691
 
676
- export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayButtonRequestDto, 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 PayButtonPublicConsumeReqDto, type PayButtonPublicResponseDto, type PayButtonResponse, 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 UpdatePayButtonStatusDto, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
692
+ export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayButtonRequestDto, type CreatePayinButtonRequestDto, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type CursorQuery, 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 PayButtonData, type PayButtonPublicConsumeReqDto, type PayButtonPublicResponseDto, type PayButtonResponse, 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 UpdatePayButtonStatusDto, type UpdatePayButtonStatusDtos, 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 S=Object.create;var y=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var O=(a,e)=>{for(var t in e)y(a,t,{get:e[t],enumerable:!0})},B=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of L(e))!N.call(a,n)&&n!==t&&y(a,n,{get:()=>e[n],enumerable:!(r=z(e,n))||r.enumerable});return a};var Q=(a,e,t)=>(t=a!=null?S(H(a)):{},B(e||!a||!a.__esModule?y(t,"default",{value:a,enumerable:!0}):t,a)),F=a=>B(y({},"__esModule",{value:!0}),a);var j={};O(j,{MorambaClient:()=>$,UserType:()=>k,monadApprove:()=>J,sepoliaApprove:()=>K});module.exports=F(j);var E=Q(require("axios")),l=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 I=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,I.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 R=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 w=class{constructor(e){this.http=e}createPayButton(e,t){return this.http.post("/morambacrypto/pay/create/button",e,{Authorization:`Bearer ${t}`})}};var $=class{constructor(e){this.http=new l(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 R(this.http),this.payinButton=new A(this.http),this.payButton=new w(this.http)}};var k=(o=>(o.CUSTOMER="customer",o.VENDOR="vendor",o.AI_AGENT="AI_agent",o.DEVICE="device",o.OTHER="other",o))(k||{});var i=require("ethers");var T={rpc:"https://testnet-rpc.monad.xyz",spender:"0x778501615Dfd26e42e58b233325ebE352f848F01",token:"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4",decimals:6,defaultAmount:"1000"},G={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function J(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=a,o=T,m=new i.ethers.JsonRpcProvider(o.rpc),c=new i.ethers.Wallet(e,m),D=["function approve(address spender, uint256 value) external returns (bool)"],M=new i.ethers.Contract(o.token,D,c),u=n!=null?n:o.decimals,h=r!=null?r:o.defaultAmount,v=t?i.ethers.MaxUint256:i.ethers.parseUnits(h,u);console.log("\u26A1 Monad approve()"),console.log("RPC:",o.rpc),console.log("Token:",o.token),console.log("Spender:",o.spender),console.log("Decimals:",u),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let s=await M.approve(o.spender,v);console.log("\u{1F4E4} TX:",s.hash);let d=await s.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:s.hash,receipt:d}}var p=require("ethers");async function K(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=a,o=G,m=new p.ethers.JsonRpcProvider(o.rpc),c=new p.ethers.Wallet(e,m),D=["function approve(address spender, uint256 value) external returns (bool)"],M=new p.ethers.Contract(o.token,D,c),u=n!=null?n:o.decimals,h=r!=null?r:o.defaultAmount,v=t?p.ethers.MaxUint256:p.ethers.parseUnits(h,u);console.log("\u26A1 Sepolia approve()"),console.log("RPC:",o.rpc),console.log("Token:",o.token),console.log("Spender:",o.spender),console.log("Decimals:",u),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let s=await M.approve(o.spender,v);console.log("\u{1F4E4} TX:",s.hash);let d=await s.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:s.hash,receipt:d}}0&&(module.exports={MorambaClient,UserType,monadApprove,sepoliaApprove});
1
+ "use strict";var G=Object.create;var y=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var O=(a,e)=>{for(var t in e)y(a,t,{get:e[t],enumerable:!0})},$=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of L(e))!N.call(a,n)&&n!==t&&y(a,n,{get:()=>e[n],enumerable:!(r=z(e,n))||r.enumerable});return a};var Q=(a,e,t)=>(t=a!=null?G(H(a)):{},$(e||!a||!a.__esModule?y(t,"default",{value:a,enumerable:!0}):t,a)),F=a=>$(y({},"__esModule",{value:!0}),a);var j={};O(j,{MorambaClient:()=>v,UserType:()=>I,monadApprove:()=>J,sepoliaApprove:()=>K});module.exports=F(j);var k=Q(require("axios")),l=class{constructor(e,t={},r=4,n=300){this.client=k.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 E=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,E.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 R=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 w=class{constructor(e){this.http=e}createPayButton(e,t){return this.http.post("/morambacrypto/pay/create/button",e,{Authorization:`Bearer ${t}`})}activatePayButton(e,t){return this.http.post("/morambacrypto/paybutton/active",e,{Authorization:`Bearer ${t}`})}deactivatePayButton(e,t){return this.http.post("/morambacrypto/paybutton/deactivate",e,{Authorization:`Bearer ${t}`})}getPayButtonList(e,t={}){let r=new URLSearchParams;return t.limit&&r.append("limit",String(t.limit)),t.forward&&r.append("cursor",t.forward),t.backward&&r.append("cursor",t.backward),this.http.get(`/morambacrypto/paybutton/all?${r.toString()}`,{Authorization:`Bearer ${e}`})}};var v=class{constructor(e){this.http=new l(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 R(this.http),this.payoutDestination=new x(this.http),this.payinButton=new A(this.http),this.payButton=new w(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"},S={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function J(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),D=["function approve(address spender, uint256 value) external returns (bool)"],M=new s.ethers.Contract(o.token,D,c),u=n!=null?n:o.decimals,h=r!=null?r:o.defaultAmount,B=t?s.ethers.MaxUint256:s.ethers.parseUnits(h,u);console.log("\u26A1 Monad approve()"),console.log("RPC:",o.rpc),console.log("Token:",o.token),console.log("Spender:",o.spender),console.log("Decimals:",u),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let i=await M.approve(o.spender,B);console.log("\u{1F4E4} TX:",i.hash);let d=await i.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:i.hash,receipt:d}}var p=require("ethers");async function K(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=a,o=S,m=new p.ethers.JsonRpcProvider(o.rpc),c=new p.ethers.Wallet(e,m),D=["function approve(address spender, uint256 value) external returns (bool)"],M=new p.ethers.Contract(o.token,D,c),u=n!=null?n:o.decimals,h=r!=null?r:o.defaultAmount,B=t?p.ethers.MaxUint256:p.ethers.parseUnits(h,u);console.log("\u26A1 Sepolia approve()"),console.log("RPC:",o.rpc),console.log("Token:",o.token),console.log("Spender:",o.spender),console.log("Decimals:",u),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let i=await M.approve(o.spender,B);console.log("\u{1F4E4} TX:",i.hash);let d=await i.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:i.hash,receipt:d}}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/apis/payin_button.api.ts","../src/apis/pay_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\";\nimport { CreatePayButtonRequestDto, PayButtonResponse } from \"../types/pay-button.types\";\nexport class PayButtonAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayButton(payload: CreatePayButtonRequestDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/pay/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, PayButtonAPI, 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 public payButton: PayButtonAPI;\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 this.payButton = new PayButtonAPI(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,EAA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C/B,QAAQ,IAAI,WAAYA,EAAI,OAAO,EACnC,QAAQ,IAAI,YAAaM,CAAQ,EACjC,QAAQ,IAAI,UAAWT,EAAY,YAAcU,CAAW,EAC5D,QAAQ,IAAI,QAAS,MAAMJ,EAAO,WAAW,CAAC,EAE9C,IAAMM,EAAK,MAAMJ,EAAS,QAAQL,EAAI,QAASQ,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":["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","PayButtonAPI","http","payload","jwtToken","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","PayinButtonAPI","PayButtonAPI","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/apis/pay_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\";\nimport { CreatePayButtonRequestDto, CursorQuery, PayButtonResponse, UpdatePayButtonStatusDto } from \"../types/pay-button.types\";\nexport class PayButtonAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayButton(payload: CreatePayButtonRequestDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/pay/create/button`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n activatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/paybutton/active`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n deactivatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/paybutton/deactivate`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayButtonList(\n jwtToken: string,\n query: CursorQuery = {}\n ): Promise<PayButtonResponse> {\n const params = new URLSearchParams();\n\n if (query.limit) params.append(\"limit\", String(query.limit));\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/paybutton/all?${params.toString()}`,\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, PayButtonAPI, 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 public payButton: PayButtonAPI;\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 this.payButton = new PayButtonAPI(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,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ios","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","PayButtonAPI","http","payload","jwtToken","query","params","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","PayinButtonAPI","PayButtonAPI","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 E from"axios";var y=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(i=>setTimeout(i,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 I}from"ulid";var l=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_${I()}@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 R=class{constructor(e){this.http=e}createPayinButton(e,t){return this.http.post("/morambacrypto/payin/create/button",e,{Authorization:`Bearer ${t}`})}};var A=class{constructor(e){this.http=e}createPayButton(e,t){return this.http.post("/morambacrypto/pay/create/button",e,{Authorization:`Bearer ${t}`})}};var v=class{constructor(e){this.http=new y(e.baseURL,{"Content-Type":"application/json"}),this.auth=new l(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 R(this.http),this.payButton=new A(this.http)}};var k=(a=>(a.CUSTOMER="customer",a.VENDOR="vendor",a.AI_AGENT="AI_agent",a.DEVICE="device",a.OTHER="other",a))(k||{});import{ethers as h}from"ethers";var $={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 kt(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=$,i=new h.JsonRpcProvider(a.rpc),p=new h.Wallet(e,i),w=["function approve(address spender, uint256 value) external returns (bool)"],D=new h.Contract(a.token,w,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,M=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 s=await D.approve(a.spender,M);console.log("\u{1F4E4} TX:",s.hash);let u=await s.wait();return console.log("\u2705 Block:",u.blockNumber),{hash:s.hash,receipt:u}}import{ethers as d}from"ethers";async function zt(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=B,i=new d.JsonRpcProvider(a.rpc),p=new d.Wallet(e,i),w=["function approve(address spender, uint256 value) external returns (bool)"],D=new d.Contract(a.token,w,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,M=t?d.MaxUint256:d.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 s=await D.approve(a.spender,M);console.log("\u{1F4E4} TX:",s.hash);let u=await s.wait();return console.log("\u2705 Block:",u.blockNumber),{hash:s.hash,receipt:u}}export{v as MorambaClient,k as UserType,kt as monadApprove,zt as sepoliaApprove};
1
+ import k from"axios";var y=class{constructor(e,t={},r=4,n=300){this.client=k.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 E}from"ulid";var l=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_${E()}@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 R=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 x=class{constructor(e){this.http=e}createPayinButton(e,t){return this.http.post("/morambacrypto/payin/create/button",e,{Authorization:`Bearer ${t}`})}};var A=class{constructor(e){this.http=e}createPayButton(e,t){return this.http.post("/morambacrypto/pay/create/button",e,{Authorization:`Bearer ${t}`})}activatePayButton(e,t){return this.http.post("/morambacrypto/paybutton/active",e,{Authorization:`Bearer ${t}`})}deactivatePayButton(e,t){return this.http.post("/morambacrypto/paybutton/deactivate",e,{Authorization:`Bearer ${t}`})}getPayButtonList(e,t={}){let r=new URLSearchParams;return t.limit&&r.append("limit",String(t.limit)),t.forward&&r.append("cursor",t.forward),t.backward&&r.append("cursor",t.backward),this.http.get(`/morambacrypto/paybutton/all?${r.toString()}`,{Authorization:`Bearer ${e}`})}};var B=class{constructor(e){this.http=new y(e.baseURL,{"Content-Type":"application/json"}),this.auth=new l(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 R(this.http),this.payinButton=new x(this.http),this.payButton=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 It(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),w=["function approve(address spender, uint256 value) external returns (bool)"],D=new h.Contract(a.token,w,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,M=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 D.approve(a.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}}import{ethers as d}from"ethers";async function zt(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=$,s=new d.JsonRpcProvider(a.rpc),p=new d.Wallet(e,s),w=["function approve(address spender, uint256 value) external returns (bool)"],D=new d.Contract(a.token,w,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,M=t?d.MaxUint256:d.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 D.approve(a.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}}export{B as MorambaClient,I as UserType,It as monadApprove,zt as sepoliaApprove};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -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/apis/payin_button.api.ts","../src/apis/pay_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\";\nimport { CreatePayButtonRequestDto, PayButtonResponse } from \"../types/pay-button.types\";\nexport class PayButtonAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayButton(payload: CreatePayButtonRequestDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/pay/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, PayButtonAPI, 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 public payButton: PayButtonAPI;\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 this.payButton = new PayButtonAPI(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,EAAI,IAAI,CAC/B,CACA,MACIH,EACAC,EACAC,EAAuC,CAAC,EAC9B,CACV,OAAO,KAAK,OACP,MAASF,EAAKC,EAAM,CAAE,QAASC,CAAa,CAAC,EAC7C,KA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AQ,WAAW,EAEpC,CAAE,KAAMD,EAAG,KAAM,QAAAC,CAAQ,CACpC,CEpDA,OAAS,UAAAC,MAAc,SAUvB,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","PayButtonAPI","http","payload","jwtToken","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","PayinButtonAPI","PayButtonAPI","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/apis/pay_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\";\nimport { CreatePayButtonRequestDto, CursorQuery, PayButtonResponse, UpdatePayButtonStatusDto } from \"../types/pay-button.types\";\nexport class PayButtonAPI {\n constructor(\n private http: HttpClient\n ) { }\n createPayButton(payload: CreatePayButtonRequestDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/pay/create/button`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n activatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/paybutton/active`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n\n deactivatePayButton(payload: UpdatePayButtonStatusDto, jwtToken: string): Promise<PayButtonResponse> {\n\n return this.http.post(\n `/morambacrypto/paybutton/deactivate`,\n payload,\n {\n Authorization: `Bearer ${jwtToken}`,\n }\n );\n }\n getPayButtonList(\n jwtToken: string,\n query: CursorQuery = {}\n ): Promise<PayButtonResponse> {\n const params = new URLSearchParams();\n\n if (query.limit) params.append(\"limit\", String(query.limit));\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/paybutton/all?${params.toString()}`,\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, PayButtonAPI, 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 public payButton: PayButtonAPI;\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 this.payButton = new PayButtonAPI(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,EAAI,IAAI,CAC/B,CACA,MACIH,EACAC,EACAC,EAAuC,CAAC,EAC9B,CACV,OAAO,KAAK,OACP,MAASF,EAAKC,EAAM,CAAE,QAASC,CAAa,CAAC,EAC7C,KAAMC,GAA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AAI,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","PayButtonAPI","http","payload","jwtToken","query","params","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","PayoutDestinationAPI","PayinButtonAPI","PayButtonAPI","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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morambacrypto/connect",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "This library use for interact with moramba-crypto project",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",