@spritz-finance/service-client 0.3.13 → 0.3.14
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.
package/lib/web3/types.d.ts
CHANGED
|
@@ -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;
|