@morambacrypto/connect 0.0.25 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -446,6 +446,38 @@ interface TransactionInitData {
446
446
  nonce: string;
447
447
  }
448
448
 
449
+ interface CreatePayoutDestinationMerchant {
450
+ company_id: string;
451
+ merchant_id: string;
452
+ is_default: boolean;
453
+ payment_method: PaymentMethod;
454
+ to_wallet_address: string;
455
+ }
456
+ interface FindPayoutDestinationMerchant {
457
+ payout_destination_id: string;
458
+ }
459
+ interface PayoutDestinationMerchantResponse {
460
+ success: boolean;
461
+ message: string;
462
+ data: PayoutDestinationMerchantData;
463
+ }
464
+ interface PayoutDestinationMerchantData {
465
+ id: string;
466
+ company_id: string;
467
+ merchant_id: string;
468
+ partner_id: string;
469
+ is_default: boolean;
470
+ payment_network: string;
471
+ payment_token_name: string;
472
+ payment_token_address: string;
473
+ to_wallet_address: string;
474
+ created_at: string;
475
+ updated_at: string;
476
+ }
477
+ interface GetAPayoutDestinationMerchant {
478
+ payout_destination_id: string;
479
+ }
480
+
449
481
  declare class PayAPI {
450
482
  private http;
451
483
  constructor(http: HttpClient);
@@ -453,6 +485,13 @@ declare class PayAPI {
453
485
  Pay(payload: PayTransaction, jwtToken: string): Promise<TransactionPayResponse>;
454
486
  }
455
487
 
488
+ declare class PayoutDestinationMerchantAPI {
489
+ private http;
490
+ constructor(http: HttpClient);
491
+ createPayoutDestinationMerchant(payload: CreatePayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse>;
492
+ getPayoutDestinationMerchant(payload: GetAPayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse>;
493
+ }
494
+
456
495
  interface MorambaClientConfig {
457
496
  baseURL: string;
458
497
  apiKey: string;
@@ -467,6 +506,7 @@ declare class MorambaClient {
467
506
  payoutDestinationUser: PayoutDestinationUserAPI;
468
507
  payinUser: PayinUserAPI;
469
508
  pay: PayAPI;
509
+ payoutDestinationMerchant: PayoutDestinationMerchantAPI;
470
510
  constructor(config: MorambaClientConfig);
471
511
  }
472
512
 
@@ -492,4 +532,4 @@ declare function sepoliaApprove(options: SepoliaApproveOptions): Promise<{
492
532
  receipt: any;
493
533
  }>;
494
534
 
495
- export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinUser, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestinationUser, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
535
+ export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestinationMerchant, type FindPayoutDestinationUser, type GetAPayoutDestinationMerchant, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationMerchantData, type PayoutDestinationMerchantResponse, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
package/dist/index.d.ts CHANGED
@@ -446,6 +446,38 @@ interface TransactionInitData {
446
446
  nonce: string;
447
447
  }
448
448
 
449
+ interface CreatePayoutDestinationMerchant {
450
+ company_id: string;
451
+ merchant_id: string;
452
+ is_default: boolean;
453
+ payment_method: PaymentMethod;
454
+ to_wallet_address: string;
455
+ }
456
+ interface FindPayoutDestinationMerchant {
457
+ payout_destination_id: string;
458
+ }
459
+ interface PayoutDestinationMerchantResponse {
460
+ success: boolean;
461
+ message: string;
462
+ data: PayoutDestinationMerchantData;
463
+ }
464
+ interface PayoutDestinationMerchantData {
465
+ id: string;
466
+ company_id: string;
467
+ merchant_id: string;
468
+ partner_id: string;
469
+ is_default: boolean;
470
+ payment_network: string;
471
+ payment_token_name: string;
472
+ payment_token_address: string;
473
+ to_wallet_address: string;
474
+ created_at: string;
475
+ updated_at: string;
476
+ }
477
+ interface GetAPayoutDestinationMerchant {
478
+ payout_destination_id: string;
479
+ }
480
+
449
481
  declare class PayAPI {
450
482
  private http;
451
483
  constructor(http: HttpClient);
@@ -453,6 +485,13 @@ declare class PayAPI {
453
485
  Pay(payload: PayTransaction, jwtToken: string): Promise<TransactionPayResponse>;
454
486
  }
455
487
 
488
+ declare class PayoutDestinationMerchantAPI {
489
+ private http;
490
+ constructor(http: HttpClient);
491
+ createPayoutDestinationMerchant(payload: CreatePayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse>;
492
+ getPayoutDestinationMerchant(payload: GetAPayoutDestinationMerchant, jwtToken: string): Promise<PayoutDestinationMerchantResponse>;
493
+ }
494
+
456
495
  interface MorambaClientConfig {
457
496
  baseURL: string;
458
497
  apiKey: string;
@@ -467,6 +506,7 @@ declare class MorambaClient {
467
506
  payoutDestinationUser: PayoutDestinationUserAPI;
468
507
  payinUser: PayinUserAPI;
469
508
  pay: PayAPI;
509
+ payoutDestinationMerchant: PayoutDestinationMerchantAPI;
470
510
  constructor(config: MorambaClientConfig);
471
511
  }
472
512
 
@@ -492,4 +532,4 @@ declare function sepoliaApprove(options: SepoliaApproveOptions): Promise<{
492
532
  receipt: any;
493
533
  }>;
494
534
 
495
- export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinUser, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestinationUser, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
535
+ export { type CompanyData, type CompanyListItem, type CreateCompanyPayload, type CreateCompanyResponse, type CreateJwtPayload, type CreateJwtResponse, type CreateMerchantPayload, type CreateMerchantResponse, type CreatePayinUser, type CreatePayoutDestinationMerchant, type CreatePayoutDestinationUser, type CreateUserPayload, type CreateUserResponse, type FindPayoutDestinationMerchant, type FindPayoutDestinationUser, type GetAPayoutDestinationMerchant, type GetAPayoutDestinationUser, type GetCompaniesQuery, type GetCompaniesResponse, type GetMerchantListResponse, type GetMerchantQuery, type GetMerchantResponse, type GetPayinUser, type GetUserListResponse, type GetUserQuery, type GetUserResponse, type InitTransaction, type JwtTokenData, type MerchantData, type MerchantListData, type MerchantListQuery, type MonadApproveOptions, MorambaClient, type MorambaClientConfig, type PaginationData, type PayTransaction, type PayinUserData, type PayinUserResponse, type PaymentMethod, type PayoutDestinationMerchantData, type PayoutDestinationMerchantResponse, type PayoutDestinationUserData, type PayoutDestinationUserResponse, type SepoliaApproveOptions, type TransactionInitData, type TransactionInitResponse, type TransactionPayResponse, type UpdateCompanyEmailPayload, type UpdateCompanyEmailResponse, type UpdateCompanyPaymentPayload, type UpdateCompanyPaymentResponse, type UpdateMerchantEmailPayload, type UpdateMerchantEmailResponse, type UpdateMerchantPaymentPayload, type UpdateMerchantPaymentResponse, type UpdatePayoutDestinationUser, type UpdateUserEmailPayload, type UpdateUserEmailResponse, type UpdateUserPaymentPayload, type UpdateUserPaymentResponse, type UserData, type UserListData, type UserListQuery, UserType, monadApprove, sepoliaApprove };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var I=Object.create;var u=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var B=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},M=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of G(e))!L.call(a,o)&&o!==t&&u(a,o,{get:()=>e[o],enumerable:!(r=T(e,o))||r.enumerable});return a};var z=(a,e,t)=>(t=a!=null?I(S(a)):{},M(e||!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>M(u({},"__esModule",{value:!0}),a);var Q={};B(Q,{MorambaClient:()=>w,UserType:()=>k,monadApprove:()=>N,sepoliaApprove:()=>O});module.exports=H(Q);var v=z(require("axios")),y=class{constructor(e,t={},r=4,o=300){this.client=v.default.create({baseURL:e,headers:t,timeout:1e4}),this.maxRetries=r,this.retryDelay=o,this.setupRetryInterceptor()}get axiosInstance(){return this.client}setupRetryInterceptor(){this.client.interceptors.response.use(e=>e,async e=>{var n;let t=e.config;if(!t)throw e;let r=(n=e.response)==null?void 0:n.status;if(r&&r>=400&&r<500&&r!==429||(t._retryCount||(t._retryCount=0),t._retryCount>=this.maxRetries))throw e;t._retryCount++;let o=this.retryDelay*Math.pow(2,t._retryCount);return await new Promise(m=>setTimeout(m,o)),this.client(t)})}post(e,t,r={}){return this.client.post(e,t,{headers:r}).then(o=>o.data)}patch(e,t,r={}){return this.client.patch(e,t,{headers:r}).then(o=>o.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 _=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 x=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 w=class{constructor(e){this.http=new y(e.baseURL,{"Content-Type":"application/json"}),this.auth=new g(this.http,e.partnerId,e.apiKey),this.company=new P(this.http),this.merchant=new f(this.http),this.user=new U(this.http),this.payoutDestinationUser=new _(this.http),this.payinUser=new C(this.http),this.pay=new x(this.http)}};var k=(n=>(n.CUSTOMER="customer",n.VENDOR="vendor",n.AI_AGENT="AI_agent",n.DEVICE="device",n.OTHER="other",n))(k||{});var i=require("ethers");var $={rpc:"https://testnet-rpc.monad.xyz",spender:"0x778501615Dfd26e42e58b233325ebE352f848F01",token:"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4",decimals:6,defaultAmount:"1000"},D={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function N(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:o}=a,n=$,m=new i.ethers.JsonRpcProvider(n.rpc),c=new i.ethers.Wallet(e,m),b=["function approve(address spender, uint256 value) external returns (bool)"],A=new i.ethers.Contract(n.token,b,c),d=o!=null?o:n.decimals,l=r!=null?r:n.defaultAmount,R=t?i.ethers.MaxUint256:i.ethers.parseUnits(l,d);console.log("\u26A1 Monad approve()"),console.log("RPC:",n.rpc),console.log("Token:",n.token),console.log("Spender:",n.spender),console.log("Decimals:",d),console.log("Amount:",t?"UNLIMITED":l),console.log("From:",await c.getAddress());let s=await A.approve(n.spender,R);console.log("\u{1F4E4} TX:",s.hash);let h=await s.wait();return console.log("\u2705 Block:",h.blockNumber),{hash:s.hash,receipt:h}}var p=require("ethers");async function O(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:o}=a,n=D,m=new p.ethers.JsonRpcProvider(n.rpc),c=new p.ethers.Wallet(e,m),b=["function approve(address spender, uint256 value) external returns (bool)"],A=new p.ethers.Contract(n.token,b,c),d=o!=null?o:n.decimals,l=r!=null?r:n.defaultAmount,R=t?p.ethers.MaxUint256:p.ethers.parseUnits(l,d);console.log("\u26A1 Sepolia approve()"),console.log("RPC:",n.rpc),console.log("Token:",n.token),console.log("Spender:",n.spender),console.log("Decimals:",d),console.log("Amount:",t?"UNLIMITED":l),console.log("From:",await c.getAddress());let s=await A.approve(n.spender,R);console.log("\u{1F4E4} TX:",s.hash);let h=await s.wait();return console.log("\u2705 Block:",h.blockNumber),{hash:s.hash,receipt:h}}0&&(module.exports={MorambaClient,UserType,monadApprove,sepoliaApprove});
1
+ "use strict";var T=Object.create;var l=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var z=(a,e)=>{for(var t in e)l(a,t,{get:e[t],enumerable:!0})},D=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of S(e))!L.call(a,o)&&o!==t&&l(a,o,{get:()=>e[o],enumerable:!(r=G(e,o))||r.enumerable});return a};var H=(a,e,t)=>(t=a!=null?T(B(a)):{},D(e||!a||!a.__esModule?l(t,"default",{value:a,enumerable:!0}):t,a)),N=a=>D(l({},"__esModule",{value:!0}),a);var F={};z(F,{MorambaClient:()=>M,UserType:()=>E,monadApprove:()=>O,sepoliaApprove:()=>Q});module.exports=N(F);var v=H(require("axios")),y=class{constructor(e,t={},r=4,o=300){this.client=v.default.create({baseURL:e,headers:t,timeout:1e4}),this.maxRetries=r,this.retryDelay=o,this.setupRetryInterceptor()}get axiosInstance(){return this.client}setupRetryInterceptor(){this.client.interceptors.response.use(e=>e,async e=>{var n;let t=e.config;if(!t)throw e;let r=(n=e.response)==null?void 0:n.status;if(r&&r>=400&&r<500&&r!==429||(t._retryCount||(t._retryCount=0),t._retryCount>=this.maxRetries))throw e;t._retryCount++;let o=this.retryDelay*Math.pow(2,t._retryCount);return await new Promise(m=>setTimeout(m,o)),this.client(t)})}post(e,t,r={}){return this.client.post(e,t,{headers:r}).then(o=>o.data)}patch(e,t,r={}){return this.client.patch(e,t,{headers:r}).then(o=>o.data)}get(e,t={}){return this.client.get(e,{headers:t}).then(r=>r.data)}};var $=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,$.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 _=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 x=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 M=class{constructor(e){this.http=new y(e.baseURL,{"Content-Type":"application/json"}),this.auth=new g(this.http,e.partnerId,e.apiKey),this.company=new P(this.http),this.merchant=new f(this.http),this.user=new U(this.http),this.payoutDestinationUser=new _(this.http),this.payinUser=new C(this.http),this.pay=new x(this.http),this.payoutDestinationMerchant=new b(this.http)}};var E=(n=>(n.CUSTOMER="customer",n.VENDOR="vendor",n.AI_AGENT="AI_agent",n.DEVICE="device",n.OTHER="other",n))(E||{});var i=require("ethers");var k={rpc:"https://testnet-rpc.monad.xyz",spender:"0x778501615Dfd26e42e58b233325ebE352f848F01",token:"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4",decimals:6,defaultAmount:"1000"},I={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function O(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:o}=a,n=k,m=new i.ethers.JsonRpcProvider(n.rpc),c=new i.ethers.Wallet(e,m),A=["function approve(address spender, uint256 value) external returns (bool)"],R=new i.ethers.Contract(n.token,A,c),d=o!=null?o:n.decimals,h=r!=null?r:n.defaultAmount,w=t?i.ethers.MaxUint256:i.ethers.parseUnits(h,d);console.log("\u26A1 Monad approve()"),console.log("RPC:",n.rpc),console.log("Token:",n.token),console.log("Spender:",n.spender),console.log("Decimals:",d),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let s=await R.approve(n.spender,w);console.log("\u{1F4E4} TX:",s.hash);let u=await s.wait();return console.log("\u2705 Block:",u.blockNumber),{hash:s.hash,receipt:u}}var p=require("ethers");async function Q(a){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:o}=a,n=I,m=new p.ethers.JsonRpcProvider(n.rpc),c=new p.ethers.Wallet(e,m),A=["function approve(address spender, uint256 value) external returns (bool)"],R=new p.ethers.Contract(n.token,A,c),d=o!=null?o:n.decimals,h=r!=null?r:n.defaultAmount,w=t?p.ethers.MaxUint256:p.ethers.parseUnits(h,d);console.log("\u26A1 Sepolia approve()"),console.log("RPC:",n.rpc),console.log("Token:",n.token),console.log("Spender:",n.spender),console.log("Decimals:",d),console.log("Amount:",t?"UNLIMITED":h),console.log("From:",await c.getAddress());let s=await R.approve(n.spender,w);console.log("\u{1F4E4} TX:",s.hash);let u=await s.wait();return console.log("\u2705 Block:",u.blockNumber),{hash:s.hash,receipt:u}}0&&(module.exports={MorambaClient,UserType,monadApprove,sepoliaApprove});
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client/HttpClient.ts","../src/apis/auth.api.ts","../src/apis/company.api.ts","../src/apis/merchant.api.ts","../src/apis/user.api.ts","../src/apis/payout_destination_user.api.ts","../src/apis/payin_user.api.ts","../src/apis/pay.api.ts","../src/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/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinUserAPI, PayoutDestinationUserAPI } from \"./apis\";\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\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 }\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();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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","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","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/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/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinUserAPI, 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\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 }\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,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K,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","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","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 v from"axios";var u=class{constructor(e,t={},r=4,n=300){this.client=v.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 E}from"ulid";var y=class{constructor(e,t,r){this.http=e;this.partnerId=t;this.apiKey=r}createJwtToken(e){let t={...e,partner_id:this.partnerId,api_key:this.apiKey};return this.http.post("/morambacrypto/create/jwt_token",t)}createJwtTokenForPublic(){let t={userid:`public_user_${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 _=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 C=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=new u(e.baseURL,{"Content-Type":"application/json"}),this.auth=new y(this.http,e.partnerId,e.apiKey),this.company=new g(this.http),this.merchant=new P(this.http),this.user=new f(this.http),this.payoutDestinationUser=new U(this.http),this.payinUser=new _(this.http),this.pay=new C(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 l}from"ethers";var w={rpc:"https://testnet-rpc.monad.xyz",spender:"0x778501615Dfd26e42e58b233325ebE352f848F01",token:"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4",decimals:6,defaultAmount:"1000"},M={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function Pt(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=w,i=new l.JsonRpcProvider(a.rpc),p=new l.Wallet(e,i),x=["function approve(address spender, uint256 value) external returns (bool)"],b=new l.Contract(a.token,x,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,A=t?l.MaxUint256:l.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 b.approve(a.spender,A);console.log("\u{1F4E4} TX:",s.hash);let d=await s.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:s.hash,receipt:d}}import{ethers as h}from"ethers";async function Ct(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=M,i=new h.JsonRpcProvider(a.rpc),p=new h.Wallet(e,i),x=["function approve(address spender, uint256 value) external returns (bool)"],b=new h.Contract(a.token,x,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,A=t?h.MaxUint256:h.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 b.approve(a.spender,A);console.log("\u{1F4E4} TX:",s.hash);let d=await s.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:s.hash,receipt:d}}export{R as MorambaClient,k as UserType,Pt as monadApprove,Ct as sepoliaApprove};
1
+ import v from"axios";var l=class{constructor(e,t={},r=4,n=300){this.client=v.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 $}from"ulid";var y=class{constructor(e,t,r){this.http=e;this.partnerId=t;this.apiKey=r}createJwtToken(e){let t={...e,partner_id:this.partnerId,api_key:this.apiKey};return this.http.post("/morambacrypto/create/jwt_token",t)}createJwtTokenForPublic(){let t={userid:`public_user_${$()}@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 _=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 C=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 w=class{constructor(e){this.http=new l(e.baseURL,{"Content-Type":"application/json"}),this.auth=new y(this.http,e.partnerId,e.apiKey),this.company=new g(this.http),this.merchant=new P(this.http),this.user=new f(this.http),this.payoutDestinationUser=new U(this.http),this.payinUser=new _(this.http),this.pay=new C(this.http),this.payoutDestinationMerchant=new x(this.http)}};var E=(a=>(a.CUSTOMER="customer",a.VENDOR="vendor",a.AI_AGENT="AI_agent",a.DEVICE="device",a.OTHER="other",a))(E||{});import{ethers as h}from"ethers";var M={rpc:"https://testnet-rpc.monad.xyz",spender:"0x778501615Dfd26e42e58b233325ebE352f848F01",token:"0xACED7dA017780B15e85A72207bA4Eb38693DdAE4",decimals:6,defaultAmount:"1000"},D={rpc:"https://rpc.sepolia.org",spender:"0x6E2024Da220C081059f606D9EEAe670c84Ead9Ab",token:"0xbAcEa624831C5f294a5E7FeC519232AA37ec0a8C",decimals:6,defaultAmount:"1000"};async function xt(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=M,i=new h.JsonRpcProvider(a.rpc),p=new h.Wallet(e,i),b=["function approve(address spender, uint256 value) external returns (bool)"],A=new h.Contract(a.token,b,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,R=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 A.approve(a.spender,R);console.log("\u{1F4E4} TX:",s.hash);let d=await s.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:s.hash,receipt:d}}import{ethers as u}from"ethers";async function wt(o){let{privateKey:e,unlimited:t=!0,amount:r,decimalsOverride:n}=o,a=D,i=new u.JsonRpcProvider(a.rpc),p=new u.Wallet(e,i),b=["function approve(address spender, uint256 value) external returns (bool)"],A=new u.Contract(a.token,b,p),m=n!=null?n:a.decimals,c=r!=null?r:a.defaultAmount,R=t?u.MaxUint256:u.parseUnits(c,m);console.log("\u26A1 Sepolia approve()"),console.log("RPC:",a.rpc),console.log("Token:",a.token),console.log("Spender:",a.spender),console.log("Decimals:",m),console.log("Amount:",t?"UNLIMITED":c),console.log("From:",await p.getAddress());let s=await A.approve(a.spender,R);console.log("\u{1F4E4} TX:",s.hash);let d=await s.wait();return console.log("\u2705 Block:",d.blockNumber),{hash:s.hash,receipt:d}}export{w as MorambaClient,E as UserType,xt as monadApprove,wt 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/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/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinUserAPI, PayoutDestinationUserAPI } from \"./apis\";\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\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 }\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,OA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G,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","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","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/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/HttpClient\";\nimport { AuthAPI } from \"./apis/auth.api\";\nimport { CompanyAPI } from \"./apis/company.api\";\nimport { MerchantAPI } from \"./apis/merchant.api\";\nimport { UserAPI } from \"./apis/user.api\";\nimport { PayAPI, PayinUserAPI, 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\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 }\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,CA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AAAA,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","MorambaClient","config","HttpClient","AuthAPI","CompanyAPI","MerchantAPI","UserAPI","PayoutDestinationUserAPI","PayinUserAPI","PayAPI","PayoutDestinationMerchantAPI","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.25",
3
+ "version": "0.0.26",
4
4
  "description": "This library use for interact with moramba-crypto project",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",