ault-sdk-ts 0.0.2-alpha.24 → 0.0.2-alpha.26
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/dist/core/network.d.ts +3 -2
- package/dist/index.cjs +47 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +43 -3
- package/dist/index.js.map +1 -1
- package/dist/rest/dex.d.ts +5 -0
- package/dist/rest/portfolio.d.ts +103 -0
- package/package.json +1 -1
package/dist/rest/dex.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RestContext } from "./context";
|
|
2
|
+
import { getPortfolioHoldings, getPortfolioFlows, getPortfolioPnl, getPortfolioTimeSeries } from "./portfolio";
|
|
2
3
|
export { initDexContext } from "./dex-fetcher";
|
|
3
4
|
/**
|
|
4
5
|
* Creates a DEX API instance bound to the given REST context.
|
|
@@ -23,6 +24,10 @@ export declare function createDexApi(context: RestContext): {
|
|
|
23
24
|
listMyTrades: (params: import("./dex.generated").ListMyTradesParams, options?: RequestInit) => Promise<import("./dex.generated").listMyTradesResponse>;
|
|
24
25
|
getBalance: (params: import("./dex.generated").GetBalanceParams, options?: RequestInit) => Promise<import("./dex.generated").getBalanceResponse>;
|
|
25
26
|
getStats: (params?: import("./dex.generated").GetStatsParams, options?: RequestInit) => Promise<import("./dex.generated").getStatsResponse>;
|
|
27
|
+
getPortfolioHoldings: typeof getPortfolioHoldings;
|
|
28
|
+
getPortfolioFlows: typeof getPortfolioFlows;
|
|
29
|
+
getPortfolioPnl: typeof getPortfolioPnl;
|
|
30
|
+
getPortfolioTimeSeries: typeof getPortfolioTimeSeries;
|
|
26
31
|
getUDFConfig: (options?: RequestInit) => Promise<import("./dex.generated").getUDFConfigResponse>;
|
|
27
32
|
getUDFTime: (options?: RequestInit) => Promise<import("./dex.generated").getUDFTimeResponse>;
|
|
28
33
|
getUDFSymbol: (params: import("./dex.generated").GetUDFSymbolParams, options?: RequestInit) => Promise<import("./dex.generated").getUDFSymbolResponse>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface PortfolioHolding {
|
|
2
|
+
denom: string;
|
|
3
|
+
symbol: string;
|
|
4
|
+
available: string;
|
|
5
|
+
locked: string;
|
|
6
|
+
total: string;
|
|
7
|
+
price: string;
|
|
8
|
+
valueUsd: string;
|
|
9
|
+
priceTs: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PortfolioUnpricedAsset {
|
|
12
|
+
denom: string;
|
|
13
|
+
symbol: string;
|
|
14
|
+
total: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PortfolioHoldings {
|
|
18
|
+
address: string;
|
|
19
|
+
holdings: PortfolioHolding[];
|
|
20
|
+
totalUsd: string;
|
|
21
|
+
unpriced?: PortfolioUnpricedAsset[];
|
|
22
|
+
partial: boolean;
|
|
23
|
+
asOf: number;
|
|
24
|
+
}
|
|
25
|
+
export interface PortfolioFlowDirection {
|
|
26
|
+
inUsd: string;
|
|
27
|
+
outUsd: string;
|
|
28
|
+
netUsd: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PortfolioFlowKind {
|
|
31
|
+
kind: string;
|
|
32
|
+
inUsd: string;
|
|
33
|
+
outUsd: string;
|
|
34
|
+
netUsd: string;
|
|
35
|
+
count: number;
|
|
36
|
+
partial: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface PortfolioFlows {
|
|
39
|
+
address: string;
|
|
40
|
+
byKind: PortfolioFlowKind[];
|
|
41
|
+
gas: PortfolioFlowDirection;
|
|
42
|
+
rewards: PortfolioFlowDirection;
|
|
43
|
+
transfer: PortfolioFlowDirection;
|
|
44
|
+
module: PortfolioFlowDirection;
|
|
45
|
+
clob: PortfolioFlowDirection;
|
|
46
|
+
tokenregistry: PortfolioFlowDirection;
|
|
47
|
+
staking: PortfolioFlowDirection;
|
|
48
|
+
partial: boolean;
|
|
49
|
+
asOf: number;
|
|
50
|
+
}
|
|
51
|
+
export interface PortfolioMarketPnL {
|
|
52
|
+
symbol: string;
|
|
53
|
+
realizedPnl: string;
|
|
54
|
+
volume: string;
|
|
55
|
+
}
|
|
56
|
+
export interface PortfolioOpenPosition {
|
|
57
|
+
denom: string;
|
|
58
|
+
symbol: string;
|
|
59
|
+
quantity: string;
|
|
60
|
+
avgCostUsd: string;
|
|
61
|
+
priceUsd: string;
|
|
62
|
+
unrealizedPnl: string;
|
|
63
|
+
}
|
|
64
|
+
export interface PortfolioPnL {
|
|
65
|
+
address: string;
|
|
66
|
+
realizedPnl: string;
|
|
67
|
+
unrealizedPnl: string;
|
|
68
|
+
totalPnl: string;
|
|
69
|
+
pnl24h: string;
|
|
70
|
+
feeImpact: string;
|
|
71
|
+
totalVolume: string;
|
|
72
|
+
volume24h: string;
|
|
73
|
+
byMarket: PortfolioMarketPnL[];
|
|
74
|
+
byAsset: PortfolioMarketPnL[];
|
|
75
|
+
openPositions?: PortfolioOpenPosition[];
|
|
76
|
+
partial: boolean;
|
|
77
|
+
asOf: number;
|
|
78
|
+
}
|
|
79
|
+
export type PortfolioTimeRange = "day" | "week" | "month" | "allTime";
|
|
80
|
+
export interface PortfolioTimePoint {
|
|
81
|
+
ts: number;
|
|
82
|
+
accountValue: string;
|
|
83
|
+
realizedPnl: string;
|
|
84
|
+
unrealizedPnl: string;
|
|
85
|
+
totalPnl: string;
|
|
86
|
+
volume: string;
|
|
87
|
+
}
|
|
88
|
+
export interface PortfolioTimeSeries {
|
|
89
|
+
address: string;
|
|
90
|
+
range: PortfolioTimeRange;
|
|
91
|
+
points: PortfolioTimePoint[];
|
|
92
|
+
partial: boolean;
|
|
93
|
+
asOf: number;
|
|
94
|
+
}
|
|
95
|
+
export interface RestResponse<T> {
|
|
96
|
+
data: T;
|
|
97
|
+
status: number;
|
|
98
|
+
headers: Headers;
|
|
99
|
+
}
|
|
100
|
+
export declare function getPortfolioHoldings(address: string, options?: RequestInit): Promise<RestResponse<PortfolioHoldings>>;
|
|
101
|
+
export declare function getPortfolioFlows(address: string, range?: PortfolioTimeRange, options?: RequestInit): Promise<RestResponse<PortfolioFlows>>;
|
|
102
|
+
export declare function getPortfolioPnl(address: string, range?: PortfolioTimeRange, options?: RequestInit): Promise<RestResponse<PortfolioPnL>>;
|
|
103
|
+
export declare function getPortfolioTimeSeries(address: string, range?: PortfolioTimeRange, options?: RequestInit): Promise<RestResponse<PortfolioTimeSeries>>;
|