@spritz-finance/service-client 0.2.89 → 0.2.91
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.
|
@@ -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;
|