@spritz-finance/service-client 0.3.13 → 0.3.15

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.
@@ -11,3 +11,4 @@ export declare function initializeExternalPayment(args: ExternalPaymentInput): P
11
11
  export declare function scheduleExternalPayment(args: ExternalPaymentInput): Promise<Payment>;
12
12
  export declare function updateExternalPaymentStatus(paymentId: string, status: PaymentStatus): Promise<Payment>;
13
13
  export declare function getDirectPaymentToken(directPaymentId: string): Promise<string | null>;
14
+ export declare function getAllPaymentsForUser(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<Payment[]>>;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getDirectPaymentToken = exports.updateExternalPaymentStatus = exports.scheduleExternalPayment = exports.initializeExternalPayment = exports.getRewardFeeAmount = exports.getRewardTransactionVolume = exports.getValidPaymentsForUser = exports.getValidPaymentsForAccount = exports.validateDirectPayment = exports.createDirectPayment = exports.PaymentsClient = void 0;
26
+ exports.getAllPaymentsForUser = exports.getDirectPaymentToken = exports.updateExternalPaymentStatus = exports.scheduleExternalPayment = exports.initializeExternalPayment = exports.getRewardFeeAmount = exports.getRewardTransactionVolume = exports.getValidPaymentsForUser = exports.getValidPaymentsForAccount = exports.validateDirectPayment = exports.createDirectPayment = exports.PaymentsClient = void 0;
27
27
  exports.PaymentsClient = __importStar(require("./paymentsClient"));
28
28
  const serviceClient_1 = require("../serviceClient");
29
29
  const PAYMENTS_ENDPOINT = '/liabilities';
@@ -90,3 +90,9 @@ async function getDirectPaymentToken(directPaymentId) {
90
90
  .then((res) => res.data);
91
91
  }
92
92
  exports.getDirectPaymentToken = getDirectPaymentToken;
93
+ async function getAllPaymentsForUser(userId) {
94
+ return serviceClient_1.baseClient
95
+ .get(`${PAYMENTS_ENDPOINT}/payments/user/${userId}/all`)
96
+ .then((res) => res.data);
97
+ }
98
+ exports.getAllPaymentsForUser = getAllPaymentsForUser;
@@ -11,3 +11,20 @@ export type ExactInQuoteResponse = {
11
11
  swapData: string;
12
12
  paymentTokenDecimals: number;
13
13
  };
14
+ export type WalletTokenBalanceInput = {
15
+ network: string;
16
+ address: string;
17
+ };
18
+ export type TokenBalance = {
19
+ address: string;
20
+ walletAddress: string;
21
+ network: string;
22
+ decimals: number;
23
+ name: string;
24
+ symbol: string;
25
+ balance: number;
26
+ balanceRaw: string;
27
+ price: number;
28
+ balanceUSD: number;
29
+ tokenImageUrl: string;
30
+ };
@@ -1,3 +1,4 @@
1
1
  export * as Web3Client from './web3ServiceClient';
2
- import { ExactInQuoteInput, ExactInQuoteResponse } from './types';
2
+ import { ExactInQuoteInput, ExactInQuoteResponse, TokenBalance, WalletTokenBalanceInput } from './types';
3
3
  export declare function getExactInQuote(input: ExactInQuoteInput): Promise<ExactInQuoteResponse>;
4
+ export declare function getTokenBalances(input: WalletTokenBalanceInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<TokenBalance[]>>;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getExactInQuote = exports.Web3Client = void 0;
26
+ exports.getTokenBalances = exports.getExactInQuote = exports.Web3Client = void 0;
27
27
  exports.Web3Client = __importStar(require("./web3ServiceClient"));
28
28
  const serviceClient_1 = require("../serviceClient");
29
29
  const WEB3_ENDPOINT = '/web3';
@@ -33,3 +33,9 @@ async function getExactInQuote(input) {
33
33
  .then((res) => res.data);
34
34
  }
35
35
  exports.getExactInQuote = getExactInQuote;
36
+ async function getTokenBalances(input) {
37
+ return serviceClient_1.baseClient
38
+ .post(`${WEB3_ENDPOINT}/token-balances`, input)
39
+ .then((res) => res.data);
40
+ }
41
+ exports.getTokenBalances = getTokenBalances;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "Service client",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",