@spritz-finance/service-client 0.3.3 → 0.3.5
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.
|
@@ -18,7 +18,7 @@ export declare enum RewardCreditSource {
|
|
|
18
18
|
OTHER = "OTHER",
|
|
19
19
|
REVENUE_SHARE = "REVENUE_SHARE"
|
|
20
20
|
}
|
|
21
|
-
type Payment = {
|
|
21
|
+
export type Payment = {
|
|
22
22
|
_id: string;
|
|
23
23
|
accountId: string;
|
|
24
24
|
amount: number;
|
|
@@ -248,10 +248,12 @@ export declare class LiabilitiesServiceClient {
|
|
|
248
248
|
createDirectPayment(args: CreateDirectPaymentArgs): Promise<DirectPayment>;
|
|
249
249
|
validateDirectPayment(args: CreateDirectPaymentArgs): Promise<DirectPayment>;
|
|
250
250
|
getValidPaymentsForAccount(accountId: string): Promise<Payment[]>;
|
|
251
|
+
getValidPaymentsForUser(userId: string): Promise<Payment[]>;
|
|
251
252
|
getRewardTransactionVolume(args: GetUsersTransactionVolumeBody): Promise<number>;
|
|
252
253
|
getRewardFeeAmount(args: GetUserRewardFeeAmountBody): Promise<number>;
|
|
253
254
|
initializeExternalPayment(args: ExternalPaymentInput): Promise<Payment>;
|
|
254
255
|
scheduleExternalPayment(args: ExternalPaymentInput): Promise<Payment>;
|
|
255
256
|
updateExternalPaymentStatus(paymentId: string, status: PaymentStatus): Promise<Payment>;
|
|
257
|
+
getDirectPaymentToken(directPaymentId: string): Promise<string | null>;
|
|
256
258
|
}
|
|
257
259
|
export {};
|
|
@@ -114,6 +114,11 @@ class LiabilitiesServiceClient {
|
|
|
114
114
|
.get(`/payments/valid-payments/account/${accountId}`)
|
|
115
115
|
.then((res) => res.data);
|
|
116
116
|
}
|
|
117
|
+
async getValidPaymentsForUser(userId) {
|
|
118
|
+
return this.client
|
|
119
|
+
.get(`/payments/valid-payments/user/${userId}`)
|
|
120
|
+
.then((res) => res.data);
|
|
121
|
+
}
|
|
117
122
|
async getRewardTransactionVolume(args) {
|
|
118
123
|
return this.client
|
|
119
124
|
.post('/payments/rewards/volume', args)
|
|
@@ -139,5 +144,10 @@ class LiabilitiesServiceClient {
|
|
|
139
144
|
.post(`/external-payment/status/${paymentId}`, { status })
|
|
140
145
|
.then((res) => res.data);
|
|
141
146
|
}
|
|
147
|
+
async getDirectPaymentToken(directPaymentId) {
|
|
148
|
+
return this.client
|
|
149
|
+
.get(`/direct-payments/${directPaymentId}/token`)
|
|
150
|
+
.then((res) => res.data);
|
|
151
|
+
}
|
|
142
152
|
}
|
|
143
153
|
exports.LiabilitiesServiceClient = LiabilitiesServiceClient;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { ExternalPayment } from './lib/graphClient/generated';
|
|
2
3
|
export declare enum UnblockUserStatus {
|
|
3
4
|
Created = "CREATED",
|
|
4
5
|
KycNeeded = "KYC_NEEDED",
|
|
@@ -95,6 +96,24 @@ export type UnblockUser = {
|
|
|
95
96
|
currency: string;
|
|
96
97
|
main_beneficiary: boolean;
|
|
97
98
|
};
|
|
99
|
+
type ExternalTransactionToken = {
|
|
100
|
+
address: string;
|
|
101
|
+
amountRaw: string;
|
|
102
|
+
amount: number;
|
|
103
|
+
decimals: number;
|
|
104
|
+
symbol: string;
|
|
105
|
+
};
|
|
106
|
+
type ExternalBlockchainTransaction = {
|
|
107
|
+
externalPaymentId: string;
|
|
108
|
+
value: number;
|
|
109
|
+
to?: string | null;
|
|
110
|
+
from?: string | null;
|
|
111
|
+
hash: string;
|
|
112
|
+
network: string;
|
|
113
|
+
asset?: string | null;
|
|
114
|
+
paymentToken?: ExternalTransactionToken | null;
|
|
115
|
+
sourceToken?: ExternalTransactionToken | null;
|
|
116
|
+
};
|
|
98
117
|
export declare class UnblockServiceClient {
|
|
99
118
|
client: AxiosInstance;
|
|
100
119
|
constructor();
|
|
@@ -104,4 +123,7 @@ export declare class UnblockServiceClient {
|
|
|
104
123
|
createUnblockAccount(input: CreateUnblockAccountInput): Promise<UnblockAccount>;
|
|
105
124
|
createUnblockUser(input: CreateUnblockUserInput): Promise<UnblockAccount>;
|
|
106
125
|
getUnblockPayment(externalPaymentId: string): Promise<UnblockPayment>;
|
|
126
|
+
getExternalPayments(accountIds: string[]): Promise<ExternalPayment[]>;
|
|
127
|
+
getBlockchainTransactions(paymentIds: string[]): Promise<ExternalBlockchainTransaction[]>;
|
|
107
128
|
}
|
|
129
|
+
export {};
|
|
@@ -40,5 +40,15 @@ class UnblockServiceClient {
|
|
|
40
40
|
.get(`/payment/id/${externalPaymentId}`)
|
|
41
41
|
.then((res) => res.data);
|
|
42
42
|
}
|
|
43
|
+
async getExternalPayments(accountIds) {
|
|
44
|
+
return this.client
|
|
45
|
+
.get(`/external-payments?accountIds=${accountIds.join(',')}`)
|
|
46
|
+
.then((res) => res.data);
|
|
47
|
+
}
|
|
48
|
+
async getBlockchainTransactions(paymentIds) {
|
|
49
|
+
return this.client
|
|
50
|
+
.get(`/blockchain-transactions?paymentIds=${paymentIds.join(',')}`)
|
|
51
|
+
.then((res) => res.data);
|
|
52
|
+
}
|
|
43
53
|
}
|
|
44
54
|
exports.UnblockServiceClient = UnblockServiceClient;
|