@swapkit/helpers 4.0.0-beta.40 → 4.0.0-beta.42
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/api/index.cjs +2 -2
- package/dist/api/index.cjs.map +8 -8
- package/dist/api/index.js +2 -2
- package/dist/api/index.js.map +8 -8
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +7 -8
- package/dist/index.js +3 -3
- package/dist/index.js.map +7 -8
- package/dist/types/api/index.d.ts +139 -79
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/microgard/endpoints.d.ts +2 -2
- package/dist/types/api/microgard/endpoints.d.ts.map +1 -1
- package/dist/types/api/microgard/types.d.ts +1 -1
- package/dist/types/api/microgard/types.d.ts.map +1 -1
- package/dist/types/api/midgard/endpoints.d.ts +49 -7
- package/dist/types/api/midgard/endpoints.d.ts.map +1 -1
- package/dist/types/api/midgard/types.d.ts +456 -15
- package/dist/types/api/midgard/types.d.ts.map +1 -1
- package/dist/types/api/swapkitApi/endpoints.d.ts +89 -71
- package/dist/types/api/swapkitApi/endpoints.d.ts.map +1 -1
- package/dist/types/api/swapkitApi/types.d.ts +335 -6245
- package/dist/types/api/swapkitApi/types.d.ts.map +1 -1
- package/dist/types/api/thorswapStatic/endpoints.d.ts +0 -2
- package/dist/types/api/thorswapStatic/endpoints.d.ts.map +1 -1
- package/dist/types/api/thorswapStatic/types.d.ts +10 -11
- package/dist/types/api/thorswapStatic/types.d.ts.map +1 -1
- package/dist/types/types/chains.d.ts +7 -2
- package/dist/types/types/chains.d.ts.map +1 -1
- package/dist/types/types/commonTypes.d.ts +0 -21
- package/dist/types/types/commonTypes.d.ts.map +1 -1
- package/dist/types/types/derivationPath.d.ts.map +1 -1
- package/dist/types/utils/asset.d.ts.map +1 -1
- package/dist/types/utils/explorerUrls.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,19 +1,61 @@
|
|
|
1
1
|
import { type Chain, type ProviderName } from "@swapkit/helpers";
|
|
2
|
-
import { type BrokerDepositChannelParams, type NearDepositChannelParams, type PriceRequest, type QuoteRequest, type TokenListProvidersResponse, type TokensResponseV2, type
|
|
3
|
-
export declare function getTrackerDetails(json:
|
|
2
|
+
import { type BrokerDepositChannelParams, type NearDepositChannelParams, type PriceRequest, type QuoteRequest, type TokenListProvidersResponse, type TokensResponseV2, type TrackingRequest } from "./types";
|
|
3
|
+
export declare function getTrackerDetails(json: TrackingRequest): Promise<import("./types").TransactionDTO>;
|
|
4
4
|
export declare function getSwapQuote(json: QuoteRequest): Promise<{
|
|
5
5
|
quoteId: string;
|
|
6
6
|
routes: {
|
|
7
|
+
providers: ProviderName[];
|
|
8
|
+
sellAsset: string;
|
|
9
|
+
sellAmount: string;
|
|
10
|
+
buyAsset: string;
|
|
11
|
+
expectedBuyAmount: string;
|
|
12
|
+
expectedBuyAmountMaxSlippage: string;
|
|
13
|
+
sourceAddress: string;
|
|
14
|
+
destinationAddress: string;
|
|
7
15
|
fees: {
|
|
8
|
-
chain: string;
|
|
9
16
|
type: import("@swapkit/helpers").FeeTypeEnum;
|
|
17
|
+
amount: string;
|
|
10
18
|
asset: string;
|
|
19
|
+
chain: string;
|
|
11
20
|
protocol: ProviderName;
|
|
12
|
-
|
|
21
|
+
}[];
|
|
22
|
+
totalSlippageBps: number;
|
|
23
|
+
legs: {
|
|
24
|
+
provider: ProviderName;
|
|
25
|
+
sellAsset: string;
|
|
26
|
+
sellAmount: string;
|
|
27
|
+
buyAsset: string;
|
|
28
|
+
buyAmount: string;
|
|
29
|
+
buyAmountMaxSlippage: string;
|
|
30
|
+
fees?: {
|
|
31
|
+
type: import("@swapkit/helpers").FeeTypeEnum;
|
|
32
|
+
amount: string;
|
|
33
|
+
asset: string;
|
|
34
|
+
chain: string;
|
|
35
|
+
protocol: ProviderName;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
}[];
|
|
38
|
+
warnings: {
|
|
39
|
+
code: import("@swapkit/helpers").WarningCodeEnum;
|
|
40
|
+
display: string;
|
|
41
|
+
tooltip?: string | undefined;
|
|
13
42
|
}[];
|
|
14
43
|
meta: {
|
|
15
44
|
tags: import("./types").PriorityLabel[];
|
|
45
|
+
assets?: {
|
|
46
|
+
asset: string;
|
|
47
|
+
price: number;
|
|
48
|
+
image: string;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
streamingInterval?: number | undefined;
|
|
51
|
+
maxStreamingQuantity?: number | undefined;
|
|
52
|
+
priceImpact?: number | undefined;
|
|
53
|
+
approvalAddress?: string | undefined;
|
|
54
|
+
affiliate?: string | undefined;
|
|
55
|
+
affiliateFee?: string | undefined;
|
|
56
|
+
txType?: import("./types").RouteQuoteTxType | undefined;
|
|
16
57
|
chainflip?: {
|
|
58
|
+
destinationAddress: string;
|
|
17
59
|
sellAsset: {
|
|
18
60
|
chain: string;
|
|
19
61
|
asset: string;
|
|
@@ -22,11 +64,10 @@ export declare function getSwapQuote(json: QuoteRequest): Promise<{
|
|
|
22
64
|
chain: string;
|
|
23
65
|
asset: string;
|
|
24
66
|
};
|
|
25
|
-
destinationAddress: string;
|
|
26
67
|
channelMetadata?: {
|
|
27
|
-
message?: string | undefined;
|
|
28
68
|
cfParameters?: string | undefined;
|
|
29
69
|
gasBudget?: string | undefined;
|
|
70
|
+
message?: string | undefined;
|
|
30
71
|
} | undefined;
|
|
31
72
|
affiliateFees?: {
|
|
32
73
|
brokerAddress: string;
|
|
@@ -45,79 +86,42 @@ export declare function getSwapQuote(json: QuoteRequest): Promise<{
|
|
|
45
86
|
maxBoostFeeBps?: number | undefined;
|
|
46
87
|
} | undefined;
|
|
47
88
|
near?: {
|
|
89
|
+
destinationAddress: string;
|
|
48
90
|
sellAsset: string;
|
|
49
91
|
buyAsset: string;
|
|
50
|
-
sellAmount: string;
|
|
51
92
|
sourceAddress: string;
|
|
52
|
-
|
|
93
|
+
sellAmount: string;
|
|
53
94
|
slippage: number;
|
|
54
95
|
affiliateFees?: {
|
|
55
|
-
feeBps: number;
|
|
56
96
|
nearId: string;
|
|
97
|
+
feeBps: number;
|
|
57
98
|
} | undefined;
|
|
58
99
|
} | undefined;
|
|
59
|
-
affiliate?: string | undefined;
|
|
60
|
-
affiliateFee?: string | undefined;
|
|
61
100
|
referrer?: string | undefined;
|
|
62
|
-
assets?: {
|
|
63
|
-
asset: string;
|
|
64
|
-
price: number;
|
|
65
|
-
image: string;
|
|
66
|
-
}[] | undefined;
|
|
67
|
-
streamingInterval?: number | undefined;
|
|
68
|
-
maxStreamingQuantity?: number | undefined;
|
|
69
|
-
priceImpact?: number | undefined;
|
|
70
|
-
approvalAddress?: string | undefined;
|
|
71
|
-
txType?: import("./types").RouteQuoteTxType | undefined;
|
|
72
101
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
providers: ProviderName[];
|
|
77
|
-
sourceAddress: string;
|
|
78
|
-
destinationAddress: string;
|
|
79
|
-
legs: {
|
|
80
|
-
provider: ProviderName;
|
|
81
|
-
sellAsset: string;
|
|
82
|
-
buyAsset: string;
|
|
83
|
-
sellAmount: string;
|
|
84
|
-
buyAmount: string;
|
|
85
|
-
buyAmountMaxSlippage: string;
|
|
86
|
-
fees?: {
|
|
87
|
-
chain: string;
|
|
88
|
-
type: import("@swapkit/helpers").FeeTypeEnum;
|
|
89
|
-
asset: string;
|
|
90
|
-
protocol: ProviderName;
|
|
91
|
-
amount: string;
|
|
92
|
-
}[] | undefined;
|
|
93
|
-
}[];
|
|
94
|
-
expectedBuyAmount: string;
|
|
95
|
-
expectedBuyAmountMaxSlippage: string;
|
|
96
|
-
totalSlippageBps: number;
|
|
97
|
-
warnings: {
|
|
98
|
-
code: import("@swapkit/helpers").WarningCodeEnum;
|
|
99
|
-
display: string;
|
|
100
|
-
tooltip?: string | undefined;
|
|
101
|
-
}[];
|
|
102
|
+
targetAddress?: string | undefined;
|
|
103
|
+
inboundAddress?: string | undefined;
|
|
104
|
+
expiration?: string | undefined;
|
|
102
105
|
memo?: string | undefined;
|
|
106
|
+
txType?: import("./types").RouteQuoteTxType | undefined;
|
|
103
107
|
tx?: string | {
|
|
104
108
|
to: string;
|
|
105
|
-
value: string;
|
|
106
109
|
from: string;
|
|
110
|
+
value: string;
|
|
107
111
|
data: string;
|
|
108
112
|
} | {
|
|
109
113
|
memo: string;
|
|
110
|
-
chainId: import("@swapkit/helpers").ChainId;
|
|
111
114
|
accountNumber: number;
|
|
112
115
|
sequence: number;
|
|
116
|
+
chainId: import("@swapkit/helpers").ChainId;
|
|
113
117
|
msgs: {
|
|
114
118
|
typeUrl: string;
|
|
115
|
-
value
|
|
119
|
+
value: unknown;
|
|
116
120
|
}[];
|
|
117
121
|
fee: {
|
|
118
122
|
amount: {
|
|
119
|
-
amount: string;
|
|
120
123
|
denom: string;
|
|
124
|
+
amount: string;
|
|
121
125
|
}[];
|
|
122
126
|
gas: string;
|
|
123
127
|
};
|
|
@@ -125,19 +129,15 @@ export declare function getSwapQuote(json: QuoteRequest): Promise<{
|
|
|
125
129
|
estimatedTime?: {
|
|
126
130
|
total: number;
|
|
127
131
|
inbound?: number | undefined;
|
|
128
|
-
outbound?: number | undefined;
|
|
129
132
|
swap?: number | undefined;
|
|
133
|
+
outbound?: number | undefined;
|
|
130
134
|
} | undefined;
|
|
131
|
-
txType?: import("./types").RouteQuoteTxType | undefined;
|
|
132
|
-
targetAddress?: string | undefined;
|
|
133
|
-
inboundAddress?: string | undefined;
|
|
134
|
-
expiration?: string | undefined;
|
|
135
135
|
}[];
|
|
136
136
|
error?: string | undefined;
|
|
137
137
|
providerErrors?: {
|
|
138
|
-
message?: string | undefined;
|
|
139
138
|
provider?: ProviderName | undefined;
|
|
140
139
|
errorCode?: import("@swapkit/helpers").ErrorCode | undefined;
|
|
140
|
+
message?: string | undefined;
|
|
141
141
|
}[] | undefined;
|
|
142
142
|
}>;
|
|
143
143
|
export declare function getChainBalance<T extends Chain>({ chain, address, scamFilter, }: {
|
|
@@ -145,23 +145,22 @@ export declare function getChainBalance<T extends Chain>({ chain, address, scamF
|
|
|
145
145
|
address: string;
|
|
146
146
|
scamFilter?: boolean;
|
|
147
147
|
}): Promise<{
|
|
148
|
-
symbol: string;
|
|
149
148
|
chain: Chain;
|
|
150
|
-
identifier: string;
|
|
151
|
-
ticker: string;
|
|
152
149
|
decimal: number;
|
|
150
|
+
ticker: string;
|
|
151
|
+
symbol: string;
|
|
153
152
|
value: string;
|
|
153
|
+
identifier: string;
|
|
154
154
|
}[]>;
|
|
155
155
|
export declare function getTokenListProviders(): Promise<TokenListProvidersResponse>;
|
|
156
156
|
export declare function getTokenList(provider: ProviderName): Promise<TokensResponseV2>;
|
|
157
157
|
export declare function getPrice(body: PriceRequest): Promise<{
|
|
158
158
|
identifier?: string | undefined;
|
|
159
159
|
provider?: string | undefined;
|
|
160
|
-
timestamp?: number | undefined;
|
|
161
160
|
cg?: {
|
|
162
|
-
name: string;
|
|
163
161
|
id: string;
|
|
164
162
|
market_cap: number;
|
|
163
|
+
name: string;
|
|
165
164
|
price_change_24h_usd: number;
|
|
166
165
|
price_change_percentage_24h_usd: number;
|
|
167
166
|
sparkline_in_7d: number[];
|
|
@@ -169,26 +168,45 @@ export declare function getPrice(body: PriceRequest): Promise<{
|
|
|
169
168
|
total_volume: number;
|
|
170
169
|
} | undefined;
|
|
171
170
|
price_usd?: number | undefined;
|
|
171
|
+
timestamp?: number | undefined;
|
|
172
172
|
}[]>;
|
|
173
|
-
export declare function getGasRate(): Promise<{
|
|
174
|
-
|
|
173
|
+
export declare function getGasRate(): Promise<(import("zod/v4").ZodSafeParseSuccess<{
|
|
174
|
+
id: number;
|
|
175
|
+
chainId: import("@swapkit/helpers").ChainId;
|
|
175
176
|
value: string;
|
|
177
|
+
unit: string;
|
|
178
|
+
createdAt: Date;
|
|
179
|
+
} | {
|
|
176
180
|
id: number;
|
|
181
|
+
chainId: import("@swapkit/helpers").ChainId;
|
|
182
|
+
value: string;
|
|
177
183
|
unit: string;
|
|
178
|
-
createdAt:
|
|
179
|
-
}[]
|
|
184
|
+
createdAt: Date;
|
|
185
|
+
}[]> & any[]) | import("zod/v4").ZodSafeParseSuccess<{
|
|
186
|
+
id: number;
|
|
187
|
+
chainId: import("@swapkit/helpers").ChainId;
|
|
188
|
+
value: string;
|
|
189
|
+
unit: string;
|
|
190
|
+
createdAt: Date;
|
|
191
|
+
} | {
|
|
192
|
+
id: number;
|
|
193
|
+
chainId: import("@swapkit/helpers").ChainId;
|
|
194
|
+
value: string;
|
|
195
|
+
unit: string;
|
|
196
|
+
createdAt: Date;
|
|
197
|
+
}[]>[]>;
|
|
180
198
|
export declare function getChainflipDepositChannel(body: BrokerDepositChannelParams): Promise<{
|
|
181
199
|
channelId: string;
|
|
182
200
|
depositAddress: string;
|
|
183
201
|
}>;
|
|
184
202
|
export declare function getNearDepositChannel(body: NearDepositChannelParams): Promise<{
|
|
185
|
-
buyAsset: string;
|
|
186
203
|
depositAddress: string;
|
|
187
204
|
depositAsset: string;
|
|
188
205
|
depositAmount: string;
|
|
206
|
+
buyAsset: string;
|
|
189
207
|
buyAssetAmount: string;
|
|
190
208
|
buyAssetAmountMaxSlippage: string;
|
|
209
|
+
tx: unknown;
|
|
191
210
|
deadline?: string | undefined;
|
|
192
|
-
tx?: unknown;
|
|
193
211
|
}>;
|
|
194
212
|
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../src/api/swapkitApi/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAGV,KAAK,YAAY,EAKlB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,0BAA0B,EAK/B,KAAK,wBAAwB,EAG7B,KAAK,YAAY,EAGjB,KAAK,YAAY,EAGjB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../src/api/swapkitApi/endpoints.ts"],"names":[],"mappings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