@spritz-finance/service-client 0.5.8 → 0.6.1

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.
@@ -42,6 +42,7 @@ export declare enum FeatureFlag {
42
42
  SpritzCardNoKycEnabled = "spritzCard.noKyc.enabled",
43
43
  SpritzCardNoKycPayments = "spritzCard.noKyc.payments",
44
44
  SpritzCardCashBackEnabled = "spritzCard.cashBack.enabled",
45
+ ModernTreasuryInstantPayments = "modernTreasury.instantPayments",
45
46
  BinanceBridgeEnabled = "binanceBridge.enabled",
46
47
  CheckbookAutomatedWires = "checkbook.automatedWires",
47
48
  CircleFundTransfers = "circle.fundTransfers",
@@ -42,6 +42,8 @@ var FeatureFlag;
42
42
  FeatureFlag["SpritzCardNoKycEnabled"] = "spritzCard.noKyc.enabled";
43
43
  FeatureFlag["SpritzCardNoKycPayments"] = "spritzCard.noKyc.payments";
44
44
  FeatureFlag["SpritzCardCashBackEnabled"] = "spritzCard.cashBack.enabled";
45
+ // Modern Treasury
46
+ FeatureFlag["ModernTreasuryInstantPayments"] = "modernTreasury.instantPayments";
45
47
  // Operations
46
48
  FeatureFlag["BinanceBridgeEnabled"] = "binanceBridge.enabled";
47
49
  FeatureFlag["CheckbookAutomatedWires"] = "checkbook.automatedWires";
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Shared enums and types extracted from the GraphQL schema.
3
+ *
4
+ * These are re-exported as top-level service-client exports so consumers
5
+ * don't need to reach into `lib/lib/graphClient/generated`.
6
+ */
7
+ export declare enum AccountProvider {
8
+ Bridge = "BRIDGE",
9
+ Checkbook = "CHECKBOOK",
10
+ MethodFi = "METHOD_FI",
11
+ Rain = "RAIN",
12
+ Unblock = "UNBLOCK"
13
+ }
14
+ export declare enum BasicPayableAccountType {
15
+ BankAccount = "BANK_ACCOUNT",
16
+ Bill = "BILL",
17
+ DebitCard = "DEBIT_CARD",
18
+ PayOthers = "PAY_OTHERS",
19
+ SpritzCard = "SPRITZ_CARD"
20
+ }
21
+ export declare enum BillType {
22
+ AutoLoan = "AutoLoan",
23
+ CreditCard = "CreditCard",
24
+ Loan = "Loan",
25
+ MobilePhone = "MobilePhone",
26
+ Mortgage = "Mortgage",
27
+ StudentLoan = "StudentLoan",
28
+ Unknown = "Unknown",
29
+ Utility = "Utility"
30
+ }
31
+ export declare enum ModuleStatus {
32
+ Active = "ACTIVE",
33
+ Disabled = "DISABLED",
34
+ Failed = "FAILED",
35
+ Initialized = "INITIALIZED",
36
+ Loading = "LOADING",
37
+ Retry = "RETRY",
38
+ Unavailable = "UNAVAILABLE",
39
+ UnderReview = "UNDER_REVIEW",
40
+ Uninitialized = "UNINITIALIZED"
41
+ }
42
+ export declare enum OnrampPaymentStatus {
43
+ AwaitingFunds = "AWAITING_FUNDS",
44
+ Cancelled = "CANCELLED",
45
+ Completed = "COMPLETED",
46
+ Failed = "FAILED",
47
+ OnHold = "ON_HOLD",
48
+ Pending = "PENDING",
49
+ Refunded = "REFUNDED",
50
+ Reversed = "REVERSED"
51
+ }
52
+ export declare enum PayableAccountType {
53
+ BankAccount = "BankAccount",
54
+ Bill = "Bill",
55
+ DebitCard = "DebitCard",
56
+ DigitalAccount = "DigitalAccount",
57
+ OneTimePayment = "OneTimePayment",
58
+ VirtualCard = "VirtualCard"
59
+ }
60
+ export declare enum PaymentDeliveryMethod {
61
+ Instant = "INSTANT",
62
+ SameDay = "SAME_DAY",
63
+ Standard = "STANDARD"
64
+ }
65
+ export declare enum PaymentStatus {
66
+ Cancelled = "CANCELLED",
67
+ Completed = "COMPLETED",
68
+ Failed = "FAILED",
69
+ Initialized = "INITIALIZED",
70
+ Pending = "PENDING",
71
+ Refunded = "REFUNDED",
72
+ ReversalInProgress = "REVERSAL_IN_PROGRESS",
73
+ Reversed = "REVERSED",
74
+ Scheduled = "SCHEDULED",
75
+ Sent = "SENT"
76
+ }
77
+ export declare enum ReferralRewardType {
78
+ AffiliateRevenueShare = "AffiliateRevenueShare",
79
+ Referral = "Referral",
80
+ ReferralClub = "ReferralClub",
81
+ Referrer = "Referrer"
82
+ }
83
+ export declare enum ReferralTier {
84
+ Local = "Local",
85
+ Tourist = "Tourist",
86
+ Vip = "VIP"
87
+ }
88
+ export interface UsBankAccountDetails {
89
+ routingNumber: string;
90
+ swiftCode?: string | null;
91
+ }
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ /**
3
+ * Shared enums and types extracted from the GraphQL schema.
4
+ *
5
+ * These are re-exported as top-level service-client exports so consumers
6
+ * don't need to reach into `lib/lib/graphClient/generated`.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ReferralTier = exports.ReferralRewardType = exports.PaymentStatus = exports.PaymentDeliveryMethod = exports.PayableAccountType = exports.OnrampPaymentStatus = exports.ModuleStatus = exports.BillType = exports.BasicPayableAccountType = exports.AccountProvider = void 0;
10
+ var AccountProvider;
11
+ (function (AccountProvider) {
12
+ AccountProvider["Bridge"] = "BRIDGE";
13
+ AccountProvider["Checkbook"] = "CHECKBOOK";
14
+ AccountProvider["MethodFi"] = "METHOD_FI";
15
+ AccountProvider["Rain"] = "RAIN";
16
+ AccountProvider["Unblock"] = "UNBLOCK";
17
+ })(AccountProvider || (exports.AccountProvider = AccountProvider = {}));
18
+ var BasicPayableAccountType;
19
+ (function (BasicPayableAccountType) {
20
+ BasicPayableAccountType["BankAccount"] = "BANK_ACCOUNT";
21
+ BasicPayableAccountType["Bill"] = "BILL";
22
+ BasicPayableAccountType["DebitCard"] = "DEBIT_CARD";
23
+ BasicPayableAccountType["PayOthers"] = "PAY_OTHERS";
24
+ BasicPayableAccountType["SpritzCard"] = "SPRITZ_CARD";
25
+ })(BasicPayableAccountType || (exports.BasicPayableAccountType = BasicPayableAccountType = {}));
26
+ var BillType;
27
+ (function (BillType) {
28
+ BillType["AutoLoan"] = "AutoLoan";
29
+ BillType["CreditCard"] = "CreditCard";
30
+ BillType["Loan"] = "Loan";
31
+ BillType["MobilePhone"] = "MobilePhone";
32
+ BillType["Mortgage"] = "Mortgage";
33
+ BillType["StudentLoan"] = "StudentLoan";
34
+ BillType["Unknown"] = "Unknown";
35
+ BillType["Utility"] = "Utility";
36
+ })(BillType || (exports.BillType = BillType = {}));
37
+ var ModuleStatus;
38
+ (function (ModuleStatus) {
39
+ ModuleStatus["Active"] = "ACTIVE";
40
+ ModuleStatus["Disabled"] = "DISABLED";
41
+ ModuleStatus["Failed"] = "FAILED";
42
+ ModuleStatus["Initialized"] = "INITIALIZED";
43
+ ModuleStatus["Loading"] = "LOADING";
44
+ ModuleStatus["Retry"] = "RETRY";
45
+ ModuleStatus["Unavailable"] = "UNAVAILABLE";
46
+ ModuleStatus["UnderReview"] = "UNDER_REVIEW";
47
+ ModuleStatus["Uninitialized"] = "UNINITIALIZED";
48
+ })(ModuleStatus || (exports.ModuleStatus = ModuleStatus = {}));
49
+ var OnrampPaymentStatus;
50
+ (function (OnrampPaymentStatus) {
51
+ OnrampPaymentStatus["AwaitingFunds"] = "AWAITING_FUNDS";
52
+ OnrampPaymentStatus["Cancelled"] = "CANCELLED";
53
+ OnrampPaymentStatus["Completed"] = "COMPLETED";
54
+ OnrampPaymentStatus["Failed"] = "FAILED";
55
+ OnrampPaymentStatus["OnHold"] = "ON_HOLD";
56
+ OnrampPaymentStatus["Pending"] = "PENDING";
57
+ OnrampPaymentStatus["Refunded"] = "REFUNDED";
58
+ OnrampPaymentStatus["Reversed"] = "REVERSED";
59
+ })(OnrampPaymentStatus || (exports.OnrampPaymentStatus = OnrampPaymentStatus = {}));
60
+ var PayableAccountType;
61
+ (function (PayableAccountType) {
62
+ PayableAccountType["BankAccount"] = "BankAccount";
63
+ PayableAccountType["Bill"] = "Bill";
64
+ PayableAccountType["DebitCard"] = "DebitCard";
65
+ PayableAccountType["DigitalAccount"] = "DigitalAccount";
66
+ PayableAccountType["OneTimePayment"] = "OneTimePayment";
67
+ PayableAccountType["VirtualCard"] = "VirtualCard";
68
+ })(PayableAccountType || (exports.PayableAccountType = PayableAccountType = {}));
69
+ var PaymentDeliveryMethod;
70
+ (function (PaymentDeliveryMethod) {
71
+ PaymentDeliveryMethod["Instant"] = "INSTANT";
72
+ PaymentDeliveryMethod["SameDay"] = "SAME_DAY";
73
+ PaymentDeliveryMethod["Standard"] = "STANDARD";
74
+ })(PaymentDeliveryMethod || (exports.PaymentDeliveryMethod = PaymentDeliveryMethod = {}));
75
+ var PaymentStatus;
76
+ (function (PaymentStatus) {
77
+ PaymentStatus["Cancelled"] = "CANCELLED";
78
+ PaymentStatus["Completed"] = "COMPLETED";
79
+ PaymentStatus["Failed"] = "FAILED";
80
+ PaymentStatus["Initialized"] = "INITIALIZED";
81
+ PaymentStatus["Pending"] = "PENDING";
82
+ PaymentStatus["Refunded"] = "REFUNDED";
83
+ PaymentStatus["ReversalInProgress"] = "REVERSAL_IN_PROGRESS";
84
+ PaymentStatus["Reversed"] = "REVERSED";
85
+ PaymentStatus["Scheduled"] = "SCHEDULED";
86
+ PaymentStatus["Sent"] = "SENT";
87
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
88
+ var ReferralRewardType;
89
+ (function (ReferralRewardType) {
90
+ ReferralRewardType["AffiliateRevenueShare"] = "AffiliateRevenueShare";
91
+ ReferralRewardType["Referral"] = "Referral";
92
+ ReferralRewardType["ReferralClub"] = "ReferralClub";
93
+ ReferralRewardType["Referrer"] = "Referrer";
94
+ })(ReferralRewardType || (exports.ReferralRewardType = ReferralRewardType = {}));
95
+ var ReferralTier;
96
+ (function (ReferralTier) {
97
+ ReferralTier["Local"] = "Local";
98
+ ReferralTier["Tourist"] = "Tourist";
99
+ ReferralTier["Vip"] = "VIP";
100
+ })(ReferralTier || (exports.ReferralTier = ReferralTier = {}));
package/lib/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./exchangeRates/types";
7
7
  export { FeaturesClient } from "./features/featuresServiceClient";
8
8
  export * from "./features/types";
9
9
  export * from "./graphClient";
10
+ export * from "./graphTypes";
10
11
  export { GrowthClient } from "./growth/growthServiceClient";
11
12
  export * from "./growth/types";
12
13
  export { LiabilitiesClient } from "./liabilities/liabilitiesServiceClient";
package/lib/index.js CHANGED
@@ -28,6 +28,7 @@ var featuresServiceClient_1 = require("./features/featuresServiceClient");
28
28
  Object.defineProperty(exports, "FeaturesClient", { enumerable: true, get: function () { return featuresServiceClient_1.FeaturesClient; } });
29
29
  __exportStar(require("./features/types"), exports);
30
30
  __exportStar(require("./graphClient"), exports);
31
+ __exportStar(require("./graphTypes"), exports);
31
32
  var growthServiceClient_1 = require("./growth/growthServiceClient");
32
33
  Object.defineProperty(exports, "GrowthClient", { enumerable: true, get: function () { return growthServiceClient_1.GrowthClient; } });
33
34
  __exportStar(require("./growth/types"), exports);
@@ -1,4 +1,7 @@
1
1
  export * as PlatformClient from "./platformServiceClient";
2
- import { TabapayBalancesResponse, ValidateBillData, ValidateBillRequest } from "./types";
2
+ import { IssuePayoutData, IssuePayoutRequest, MTBalancesData, SendPaymentData, SendPaymentRequest, TabapayBalancesResponse, ValidateBillData, ValidateBillRequest } from "./types";
3
3
  export declare function validateBill(request: ValidateBillRequest): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<ValidateBillData>>;
4
4
  export declare function tabapayBalances(): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<TabapayBalancesResponse>>;
5
+ export declare function issuePayout(request: IssuePayoutRequest): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<IssuePayoutData>>;
6
+ export declare function sendPayment(request: SendPaymentRequest): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<SendPaymentData>>;
7
+ export declare function modernTreasuryBalances(): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<MTBalancesData>>;
@@ -39,6 +39,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.PlatformClient = void 0;
40
40
  exports.validateBill = validateBill;
41
41
  exports.tabapayBalances = tabapayBalances;
42
+ exports.issuePayout = issuePayout;
43
+ exports.sendPayment = sendPayment;
44
+ exports.modernTreasuryBalances = modernTreasuryBalances;
42
45
  exports.PlatformClient = __importStar(require("./platformServiceClient"));
43
46
  const axios_1 = __importDefault(require("axios"));
44
47
  // @ts-expect-error no type declarations for axios-token-interceptor
@@ -66,3 +69,19 @@ async function tabapayBalances() {
66
69
  .get(`${BILLPAY_ENDPOINT}/balances`)
67
70
  .then((res) => res.data);
68
71
  }
72
+ const MT_ENDPOINT = "/v1/modern-treasury";
73
+ async function issuePayout(request) {
74
+ return platformClient
75
+ .post(`${MT_ENDPOINT}/issue-payout`, request)
76
+ .then((res) => res.data);
77
+ }
78
+ async function sendPayment(request) {
79
+ return platformClient
80
+ .post(`${MT_ENDPOINT}/send-payment`, request)
81
+ .then((res) => res.data);
82
+ }
83
+ async function modernTreasuryBalances() {
84
+ return platformClient
85
+ .get(`${MT_ENDPOINT}/balances`)
86
+ .then((res) => res.data);
87
+ }
@@ -12,3 +12,57 @@ export type TabapayBalancesResponse = {
12
12
  liability: string;
13
13
  reconciliation_total: string;
14
14
  };
15
+ export type PaymentRail = "rtp" | "ach_standard" | "ach_same_day" | "wire";
16
+ export interface IssuePayoutRequest {
17
+ userId: string;
18
+ debitId: string;
19
+ recipientName: string;
20
+ recipientEmail: string;
21
+ recipientType: "personal" | "third_party";
22
+ bankAccountId: string;
23
+ routingNumber: string;
24
+ accountNumber: string;
25
+ accountType?: "checking" | "savings";
26
+ amount: number;
27
+ rail: PaymentRail;
28
+ statementDescriptor?: string;
29
+ metadata?: Record<string, string>;
30
+ }
31
+ export interface IssuePayoutData {
32
+ payment_order_id: string;
33
+ status: string;
34
+ type: string;
35
+ direction: "credit";
36
+ amount: number;
37
+ currency: "USD";
38
+ external_id: string;
39
+ }
40
+ export interface SendPaymentRequest {
41
+ destination: "checkbook" | "mercury";
42
+ amount: number;
43
+ rail: PaymentRail;
44
+ reason?: string;
45
+ }
46
+ export interface SendPaymentData {
47
+ payment_order_id: string;
48
+ status: string;
49
+ type: string;
50
+ direction: "credit";
51
+ amount: number;
52
+ currency: "USD";
53
+ effective_date: string | null;
54
+ }
55
+ export interface MTAccountBalance {
56
+ type: string;
57
+ amount: number;
58
+ currency: string;
59
+ }
60
+ export interface MTAccount {
61
+ id: string;
62
+ name: string;
63
+ currency: string;
64
+ balances: MTAccountBalance[];
65
+ }
66
+ export interface MTBalancesData {
67
+ accounts: MTAccount[];
68
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.5.8",
3
+ "version": "0.6.1",
4
4
  "gitHead": "06f8e96b7b38c34df26a38da329331940675e4f8",
5
5
  "description": "Service client",
6
6
  "license": "ISC",