@@ -3,9 +3,11 @@ import {
3
3
Chain ,
4
4
ChainId ,
5
5
ChainKey ,
6
+ GetStatusRequest ,
6
7
PossibilitiesRequest ,
7
8
PossibilitiesResponse ,
8
9
QuoteRequest ,
10
+ RequestOptions ,
9
11
Route ,
10
12
RoutesRequest ,
11
13
RoutesResponse ,
@@ -18,7 +20,6 @@ import {
18
20
ToolsRequest ,
19
21
ToolsResponse ,
20
22
} from '@lifinance/types'
21
- import { GetStatusRequest } from '@lifinance/types/dist/api'
22
23
import { Signer } from 'ethers'
23
24
import {
24
25
approveToken ,
@@ -97,9 +98,10 @@ export default class LIFI {
97
98
* @throws {LifiError } Throws a LifiError if request fails.
98
99
*/
99
100
getPossibilities = async (
100
- request ?: PossibilitiesRequest
101
+ request ?: PossibilitiesRequest ,
102
+ options ?: RequestOptions
101
103
) : Promise < PossibilitiesResponse > => {
102
- return ApiService . getPossibilities ( request )
104
+ return ApiService . getPossibilities ( request , options )
103
105
}
104
106
105
107
/**
@@ -110,45 +112,58 @@ export default class LIFI {
110
112
*/
111
113
getToken = async (
112
114
chain : ChainKey | ChainId ,
113
- token : string
115
+ token : string ,
116
+ options ?: RequestOptions
114
117
) : Promise < Token > => {
115
- return ApiService . getToken ( chain , token )
118
+ return ApiService . getToken ( chain , token , options )
116
119
}
117
120
118
121
/**
119
122
* Get a quote for a token transfer
120
123
* @param {QuoteRequest } request - The configuration of the requested quote
121
124
* @throws {LifiError } - Throws a LifiError if request fails
122
125
*/
123
- getQuote = async ( request : QuoteRequest ) : Promise < Step > => {
124
- return ApiService . getQuote ( request )
126
+ getQuote = async (
127
+ request : QuoteRequest ,
128
+ options ?: RequestOptions
129
+ ) : Promise < Step > => {
130
+ return ApiService . getQuote ( request , options )
125
131
}
126
132
127
133
/**
128
134
* Check the status of a transfer. For cross chain transfers, the "bridge" parameter is required.
129
135
* @param {GetStatusRequest } request - Configuration of the requested status
130
136
* @throws {LifiError } - Throws a LifiError if request fails
131
137
*/
132
- getStatus = async ( request : GetStatusRequest ) : Promise < StatusResponse > => {
133
- return ApiService . getStatus ( request )
138
+ getStatus = async (
139
+ request : GetStatusRequest ,
140
+ options ?: RequestOptions
141
+ ) : Promise < StatusResponse > => {
142
+ return ApiService . getStatus ( request , options )
134
143
}
135
144
136
145
/**
137
146
* Get the available tools to bridge and swap tokens.
138
147
* @param {ToolsRequest? } request - The configuration of the requested tools
139
148
* @returns The tools that are available on the requested chains
140
149
*/
141
- getTools = async ( request ?: ToolsRequest ) : Promise < ToolsResponse > => {
142
- return ApiService . getTools ( request || { } )
150
+ getTools = async (
151
+ request ?: ToolsRequest ,
152
+ options ?: RequestOptions
153
+ ) : Promise < ToolsResponse > => {
154
+ return ApiService . getTools ( request || { } , options )
143
155
}
144
156
145
157
/**
146
158
* Get all known tokens.
147
159
* @param {TokensRequest? } request - The configuration of the requested tokens
148
160
* @returns The tokens that are available on the requested chains
149
161
*/
150
- getTokens = async ( request ?: TokensRequest ) : Promise < TokensResponse > => {
151
- return ApiService . getTokens ( request || { } )
162
+ getTokens = async (
163
+ request ?: TokensRequest ,
164
+ options ?: RequestOptions
165
+ ) : Promise < TokensResponse > => {
166
+ return ApiService . getTokens ( request || { } , options )
152
167
}
153
168
154
169
/**
@@ -166,8 +181,11 @@ export default class LIFI {
166
181
* @return {Promise<RoutesResponse> } The resulting routes that can be used to realize the described transfer of tokens.
167
182
* @throws {LifiError } Throws a LifiError if request fails.
168
183
*/
169
- getRoutes = async ( request : RoutesRequest ) : Promise < RoutesResponse > => {
170
- return ApiService . getRoutes ( request )
184
+ getRoutes = async (
185
+ request : RoutesRequest ,
186
+ options ?: RequestOptions
187
+ ) : Promise < RoutesResponse > => {
188
+ return ApiService . getRoutes ( request , options )
171
189
}
172
190
173
191
/**
@@ -176,8 +194,11 @@ export default class LIFI {
176
194
* @return {Promise<Step> } The step populated with the transaction data.
177
195
* @throws {LifiError } Throws a LifiError if request fails.
178
196
*/
179
- getStepTransaction = async ( step : Step ) : Promise < Step > => {
180
- return ApiService . getStepTransaction ( step )
197
+ getStepTransaction = async (
198
+ step : Step ,
199
+ options ?: RequestOptions
200
+ ) : Promise < Step > => {
201
+ return ApiService . getStepTransaction ( step , options )
181
202
}
182
203
183
204
/**
0 commit comments