File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -145,16 +145,30 @@ export type GetMyTwapOrdersResponse = {
145145} ;
146146
147147export const getMyTwapOrders = async (
148- params : { publicKey : string ; limit ?: number ; offset ?: number } ,
148+ params : {
149+ publicKey : string ;
150+ limit ?: number ;
151+ offset ?: number ;
152+ baseCurrencyPubKey ?: string ;
153+ status ?: string ;
154+ } ,
149155 options ?: RequestOptions
150156) : Promise < GetMyTwapOrdersResponse > => {
151157 const jwt = await identity . jwt ( ) ;
158+ const queryParams = new URLSearchParams ( {
159+ limit : ( params . limit ?? 0 ) . toString ( ) ,
160+ offset : ( params . offset ?? 0 ) . toString ( ) ,
161+ ...( params . baseCurrencyPubKey
162+ ? { baseCurrencyPubKey : params . baseCurrencyPubKey }
163+ : { } ) ,
164+ ...( params . status ? { status : params . status } : { } ) ,
165+ } ) ;
166+
152167 const endpoint = cleanURL (
153168 options ?. nodeURI ?? '' ,
154- `api/v0/twaps/${ params . publicKey } ?limit=${ params . limit ?? 0 } &offset=${
155- params . offset ?? 0
156- } `
169+ `api/v0/twaps/${ params . publicKey } ?${ queryParams . toString ( ) } `
157170 ) ;
171+
158172 return amm . get ( endpoint , {
159173 headers : {
160174 Authorization : `Bearer ${ jwt } ` ,
You can’t perform that action at this time.
0 commit comments