@spritz-finance/service-client 0.2.78 → 0.2.79

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.
@@ -22,11 +22,49 @@ interface ReservePaymentAddressResponse {
22
22
  network: string;
23
23
  accountId: string;
24
24
  }
25
+ export type SpritzWalletTransaction = {
26
+ _id: string;
27
+ id: string;
28
+ userId: string;
29
+ paymentId?: string;
30
+ address: string;
31
+ type: SpritzWalletTransactionType;
32
+ gasUsed: string;
33
+ gasPrice: string;
34
+ transactionCostUnits: string;
35
+ currency: string;
36
+ currencyDecimals: number;
37
+ currencyPriceUSD: number;
38
+ transactionCostUSD: number;
39
+ transactionHash: string;
40
+ status: SpritzWalletTransactionStatus;
41
+ network: string;
42
+ };
43
+ export declare enum SpritzWalletTransactionType {
44
+ PaymentAddressDeployment = "PaymentAddressDeployment",
45
+ PaymentAddressPayment = "PaymentAddressPayment",
46
+ BridgeFunds = "BridgeFunds",
47
+ SmartPayPayment = "SmartPayPayment"
48
+ }
49
+ export declare enum SpritzWalletTransactionStatus {
50
+ NoPaymentRequired = "NoPaymentRequired",
51
+ AwaitingPaymentConfirmation = "AwaitingPaymentConfirmation",
52
+ PaymentConfirmed = "PaymentConfirmed",
53
+ NotProcessed = "NotProcessed"
54
+ }
55
+ export type UpdateUserTransactionStatusEvent = {
56
+ userId: string;
57
+ status: SpritzWalletTransactionStatus;
58
+ transactionIds: string[];
59
+ paymentId?: string;
60
+ };
25
61
  export declare class TransactionsServiceClient {
26
62
  client: AxiosInstance;
27
63
  constructor();
28
64
  createPaymentInvoice(network: string, amount: number, paymentReference: string, tokenAddress?: string): Promise<UtxoInvoice>;
29
65
  reserveAddress(network: string, accountId: string): Promise<ReservePaymentAddressResponse>;
30
66
  getWalletMembership(address: string): Promise<AddressMembershipResponse>;
67
+ getOutstandingUserTransactions(userId: string): Promise<SpritzWalletTransaction[]>;
68
+ updateUserTransactionStatus(input: UpdateUserTransactionStatusEvent): Promise<boolean>;
31
69
  }
32
70
  export {};
@@ -1,8 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TransactionsServiceClient = void 0;
3
+ exports.TransactionsServiceClient = exports.SpritzWalletTransactionStatus = exports.SpritzWalletTransactionType = void 0;
4
4
  const config_1 = require("./config");
5
5
  const serviceClient_1 = require("./serviceClient");
6
+ var SpritzWalletTransactionType;
7
+ (function (SpritzWalletTransactionType) {
8
+ SpritzWalletTransactionType["PaymentAddressDeployment"] = "PaymentAddressDeployment";
9
+ SpritzWalletTransactionType["PaymentAddressPayment"] = "PaymentAddressPayment";
10
+ SpritzWalletTransactionType["BridgeFunds"] = "BridgeFunds";
11
+ SpritzWalletTransactionType["SmartPayPayment"] = "SmartPayPayment";
12
+ })(SpritzWalletTransactionType || (exports.SpritzWalletTransactionType = SpritzWalletTransactionType = {}));
13
+ var SpritzWalletTransactionStatus;
14
+ (function (SpritzWalletTransactionStatus) {
15
+ SpritzWalletTransactionStatus["NoPaymentRequired"] = "NoPaymentRequired";
16
+ SpritzWalletTransactionStatus["AwaitingPaymentConfirmation"] = "AwaitingPaymentConfirmation";
17
+ SpritzWalletTransactionStatus["PaymentConfirmed"] = "PaymentConfirmed";
18
+ SpritzWalletTransactionStatus["NotProcessed"] = "NotProcessed";
19
+ })(SpritzWalletTransactionStatus || (exports.SpritzWalletTransactionStatus = SpritzWalletTransactionStatus = {}));
6
20
  class TransactionsServiceClient {
7
21
  constructor() {
8
22
  this.client = (0, serviceClient_1.createServiceClient)({
@@ -32,5 +46,15 @@ class TransactionsServiceClient {
32
46
  .get(`/addresses/${address}/membership`)
33
47
  .then((res) => res.data);
34
48
  }
49
+ async getOutstandingUserTransactions(userId) {
50
+ return this.client
51
+ .get(`/wallet-transactions/outstanding/${userId}`)
52
+ .then((res) => res.data);
53
+ }
54
+ async updateUserTransactionStatus(input) {
55
+ return this.client
56
+ .post('/wallet-transactions/user', input)
57
+ .then((res) => res.data);
58
+ }
35
59
  }
36
60
  exports.TransactionsServiceClient = TransactionsServiceClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.2.78",
3
+ "version": "0.2.79",
4
4
  "description": "Service client",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",