@spritz-finance/service-client 0.3.34 → 0.3.36
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,7 +1,7 @@
|
|
|
1
1
|
export * as LiabilitiesClient from './liabilitiesServiceClient';
|
|
2
2
|
import { CheckbookUser } from '../lib/graphClient/generated';
|
|
3
3
|
import { ExternalBillInput } from '../payableAccounts/types';
|
|
4
|
-
import {
|
|
4
|
+
import { CheckbookCardResponse, CheckbookDebitCardResponse, CheckbookUpdateCardResponse, CreateCheckbookUserParams, CreateDebitCardInput, CreateEntityParams, MethodFiEntity, RewardTransaction } from './types';
|
|
5
5
|
export declare function getRewardTransaction(transactionId: string): Promise<RewardTransaction>;
|
|
6
6
|
export declare function createMethodFiEntity(args: CreateEntityParams): Promise<MethodFiEntity>;
|
|
7
7
|
export declare function getMethodFiEntity(userId: string): Promise<MethodFiEntity>;
|
|
@@ -12,7 +12,6 @@ export declare function createCheckbookVirtualCard(userId: string): Promise<Chec
|
|
|
12
12
|
export declare function createCheckbookDebitCard(input: CreateDebitCardInput): Promise<CheckbookDebitCardResponse>;
|
|
13
13
|
export declare function createUSBillFromAccountNumber(userId: string, accountNumber: string, merchantId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<ExternalBillInput>>;
|
|
14
14
|
export declare function getVirtualCardBalance(cardExternalId: string, userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<number>>;
|
|
15
|
-
export declare function getVirtualCardTransactions(cardExternalId: string, userId: string): Promise<CardTransaction[]>;
|
|
16
15
|
export declare function getUserIdForDirectPayment(directPaymentId: string): Promise<string>;
|
|
17
16
|
export declare function updateCheckbookVirtualCard(userId: string, cardExternalId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<CheckbookUpdateCardResponse>>;
|
|
18
17
|
export declare function addPromotionCredit(input: {
|
|
@@ -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.getRewardTransactionsFor = exports.addPromotionCredit = exports.updateCheckbookVirtualCard = exports.getUserIdForDirectPayment = exports.
|
|
26
|
+
exports.getRewardTransactionsFor = exports.addPromotionCredit = exports.updateCheckbookVirtualCard = exports.getUserIdForDirectPayment = exports.getVirtualCardBalance = exports.createUSBillFromAccountNumber = exports.createCheckbookDebitCard = exports.createCheckbookVirtualCard = exports.getCheckbookUser = exports.upsertCheckbookUser = exports.createCheckbookUser = exports.getMethodFiEntity = exports.createMethodFiEntity = exports.getRewardTransaction = exports.LiabilitiesClient = void 0;
|
|
27
27
|
exports.LiabilitiesClient = __importStar(require("./liabilitiesServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const LIABILITIES_ENDPOINT = '/liabilities';
|
|
@@ -90,12 +90,6 @@ async function getVirtualCardBalance(cardExternalId, userId) {
|
|
|
90
90
|
.then((res) => res.data);
|
|
91
91
|
}
|
|
92
92
|
exports.getVirtualCardBalance = getVirtualCardBalance;
|
|
93
|
-
async function getVirtualCardTransactions(cardExternalId, userId) {
|
|
94
|
-
return serviceClient_1.baseClient
|
|
95
|
-
.get(`${LIABILITIES_ENDPOINT}/virtual-card/card/${cardExternalId}/transactions?userId=${userId}`)
|
|
96
|
-
.then((res) => res.data);
|
|
97
|
-
}
|
|
98
|
-
exports.getVirtualCardTransactions = getVirtualCardTransactions;
|
|
99
93
|
async function getUserIdForDirectPayment(directPaymentId) {
|
|
100
94
|
return serviceClient_1.baseClient
|
|
101
95
|
.get(`${LIABILITIES_ENDPOINT}/direct-payments/${directPaymentId}/user`)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as TransactionsClient from './transactionsServiceClient';
|
|
2
2
|
import { AddressMembershipResponse, ReservePaymentAddressResponse, SpritzWalletTransaction, UpdateUserTransactionStatusEvent, UtxoInvoice } from './types';
|
|
3
|
-
export declare function createPaymentInvoice(network: string, amount: number, paymentReference: string, tokenAddress?: string, userId?: string): Promise<UtxoInvoice
|
|
3
|
+
export declare function createPaymentInvoice(network: string, amount: number, paymentReference: string, tokenAddress?: string, userId?: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<UtxoInvoice>>;
|
|
4
|
+
export declare function getAssetPriceBySymbol(symbol: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<number>>;
|
|
4
5
|
export declare function reserveAddress(network: string, accountId: string): Promise<ReservePaymentAddressResponse>;
|
|
5
6
|
export declare function getWalletMembership(address: string): Promise<AddressMembershipResponse>;
|
|
6
7
|
export declare function getOutstandingUserTransactions(userId: string, accountId: string): Promise<SpritzWalletTransaction[]>;
|
|
@@ -23,13 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.updateUserTransactionStatus = exports.getOutstandingUserTransactions = exports.getWalletMembership = exports.reserveAddress = exports.createPaymentInvoice = exports.TransactionsClient = void 0;
|
|
26
|
+
exports.updateUserTransactionStatus = exports.getOutstandingUserTransactions = exports.getWalletMembership = exports.reserveAddress = exports.getAssetPriceBySymbol = exports.createPaymentInvoice = exports.TransactionsClient = void 0;
|
|
27
27
|
exports.TransactionsClient = __importStar(require("./transactionsServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const TRANSACTIONS_ENDPOINT = '/transactions';
|
|
30
30
|
async function createPaymentInvoice(network, amount, paymentReference, tokenAddress, userId) {
|
|
31
31
|
return serviceClient_1.baseClient
|
|
32
|
-
.post(`${TRANSACTIONS_ENDPOINT}/invoices`, {
|
|
32
|
+
.post(`${TRANSACTIONS_ENDPOINT}/v2/invoices`, {
|
|
33
33
|
network,
|
|
34
34
|
amount,
|
|
35
35
|
paymentReference,
|
|
@@ -39,6 +39,12 @@ async function createPaymentInvoice(network, amount, paymentReference, tokenAddr
|
|
|
39
39
|
.then((res) => res.data);
|
|
40
40
|
}
|
|
41
41
|
exports.createPaymentInvoice = createPaymentInvoice;
|
|
42
|
+
async function getAssetPriceBySymbol(symbol) {
|
|
43
|
+
return serviceClient_1.baseClient
|
|
44
|
+
.get(`${TRANSACTIONS_ENDPOINT}/v2/asset-price/${symbol}`)
|
|
45
|
+
.then((res) => res.data);
|
|
46
|
+
}
|
|
47
|
+
exports.getAssetPriceBySymbol = getAssetPriceBySymbol;
|
|
42
48
|
async function reserveAddress(network, accountId) {
|
|
43
49
|
return serviceClient_1.baseClient
|
|
44
50
|
.post(`${TRANSACTIONS_ENDPOINT}/addresses/reserve`, {
|