@gardenfi/orderbook 0.2.0-beta.3 → 0.2.0-beta.4
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/index2.cjs +1 -1
- package/dist/index2.js +50 -97
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -11
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +7 -2
- package/dist/src/lib/orderbook/orderbook.d.ts +2 -3
- package/dist/src/lib/orderbook/orderbook.types.d.ts +22 -5
- package/package.json +2 -2
- package/dist/index8.cjs +0 -1
- package/dist/index8.js +0 -9
package/dist/index2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@catalogfi/utils"),d=require("./index6.cjs"),a=require("@gardenfi/utils"),o=require("./index4.cjs");class u extends o.OrdersProvider{constructor(e){var t;const r=new a.Url("/relayer",e.url??d.MAINNET_ORDERBOOK_API);super(r),this.Url=r,this.walletClient=e.walletClient,this.auth=new a.Siwe(this.Url,e.walletClient,{...e.opts,store:((t=e.opts)==null?void 0:t.store)||new a.MemoryStorage})}static async init(e){return await new a.Siwe(new a.Url("/relayer",e.url??d.MAINNET_ORDERBOOK_API),e.walletClient,e.opts).getToken(),new u(e)}async createOrder(e){const r=await this.auth.getToken();if(r.error)return s.Err(r.error);try{const t=await s.Fetcher.post(this.Url.endpoint("create-order"),{body:JSON.stringify(e),headers:{Authorization:a.Authorization(r.val),"Content-Type":"application/json"}});return t.error?s.Err(t.error):t.result?s.Ok(t.result):s.Err("CreateOrder: Unexpected error, result is undefined")}catch(t){return s.Err("CreateOrder:",String(t))}}async fetchOrders(e,r=!1,t){var i;const n=(i=this.walletClient.account)==null?void 0:i.address;return n?e?await super.getMatchedOrders(n,r,t):await super.getUnMatchedOrders(n,t):s.Err("Wallet client does not have an account")}async subscribeToOrders(e,r,t,n,i){var c;const l=(c=this.walletClient.account)==null?void 0:c.address;return l?await super.subscribeOrders(l,e,r,t,n,i):()=>{}}async getUserOrdersCount(){var r;const e=(r=this.walletClient.account)==null?void 0:r.address;return e?super.getOrdersCount(e):s.Err("Wallet client does not have an account")}}exports.Orderbook=u;
|
package/dist/index2.js
CHANGED
|
@@ -1,104 +1,70 @@
|
|
|
1
|
-
import { Err as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { isBitcoin as _ } from "./index3.js";
|
|
7
|
-
class w extends C {
|
|
1
|
+
import { Err as s, Fetcher as h, Ok as w } from "@catalogfi/utils";
|
|
2
|
+
import { MAINNET_ORDERBOOK_API as u } from "./index6.js";
|
|
3
|
+
import { Url as c, Siwe as d, MemoryStorage as p, Authorization as O } from "@gardenfi/utils";
|
|
4
|
+
import { OrdersProvider as y } from "./index4.js";
|
|
5
|
+
class o extends y {
|
|
8
6
|
/**
|
|
9
7
|
* Creates an instance of Orderbook. Does not login to the orderbook.
|
|
10
8
|
* @constructor
|
|
11
9
|
* @param {OrderbookConfig} orderbookConfig - The configuration object for the orderbook.
|
|
12
10
|
*/
|
|
13
|
-
constructor(
|
|
14
|
-
var
|
|
15
|
-
const
|
|
11
|
+
constructor(e) {
|
|
12
|
+
var r;
|
|
13
|
+
const t = new c(
|
|
16
14
|
"/relayer",
|
|
17
|
-
|
|
15
|
+
e.url ?? u
|
|
18
16
|
);
|
|
19
|
-
super(
|
|
20
|
-
...
|
|
21
|
-
store: ((
|
|
17
|
+
super(t), this.Url = t, this.walletClient = e.walletClient, this.auth = new d(this.Url, e.walletClient, {
|
|
18
|
+
...e.opts,
|
|
19
|
+
store: ((r = e.opts) == null ? void 0 : r.store) || new p()
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
23
|
* Initializes the orderbook as well as logs in the orderbook (fetches the auth token).
|
|
26
24
|
* @param {OrderbookConfig} orderbookConfig - The configuration object for the orderbook.
|
|
27
25
|
*/
|
|
28
|
-
static async init(
|
|
29
|
-
return await new
|
|
30
|
-
new
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
).getToken(), new
|
|
26
|
+
static async init(e) {
|
|
27
|
+
return await new d(
|
|
28
|
+
new c("/relayer", e.url ?? u),
|
|
29
|
+
e.walletClient,
|
|
30
|
+
e.opts
|
|
31
|
+
).getToken(), new o(e);
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Creates an order
|
|
37
35
|
* @param {CreateOrderConfig} createOrderConfig - The configuration for the creating the order.
|
|
38
36
|
* @returns {string} The create order ID.
|
|
39
37
|
*/
|
|
40
|
-
async createOrder(
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
secretHash: s,
|
|
44
|
-
receiveAmount: n,
|
|
45
|
-
fromAsset: i,
|
|
46
|
-
toAsset: a,
|
|
47
|
-
receiveAddress: o,
|
|
48
|
-
sendAddress: f,
|
|
49
|
-
minDestinationConfirmations: O = 0,
|
|
50
|
-
timelock: S,
|
|
51
|
-
btcInputAddress: E
|
|
52
|
-
} = t, l = this.validateConfig(t);
|
|
53
|
-
if (l.error) return r(l.error);
|
|
54
|
-
const u = await this.auth.getToken();
|
|
55
|
-
if (u.error) return r(u.error);
|
|
56
|
-
const I = {
|
|
57
|
-
additional_data: { bitcoin_optional_recipient: E ?? "" }
|
|
58
|
-
}, N = {
|
|
59
|
-
nonce: t.nonce,
|
|
60
|
-
source_amount: e,
|
|
61
|
-
destination_amount: n,
|
|
62
|
-
source_asset: i.atomicSwapAddress,
|
|
63
|
-
destination_asset: a.atomicSwapAddress,
|
|
64
|
-
secret_hash: y(s),
|
|
65
|
-
source_chain: i.chain,
|
|
66
|
-
destination_chain: a.chain,
|
|
67
|
-
initiator_source_address: f,
|
|
68
|
-
initiator_destination_address: o,
|
|
69
|
-
min_destination_confirmations: O,
|
|
70
|
-
timelock: S,
|
|
71
|
-
...I,
|
|
72
|
-
//signature:''
|
|
73
|
-
fee: "1"
|
|
74
|
-
};
|
|
38
|
+
async createOrder(e) {
|
|
39
|
+
const t = await this.auth.getToken();
|
|
40
|
+
if (t.error) return s(t.error);
|
|
75
41
|
try {
|
|
76
|
-
const
|
|
42
|
+
const r = await h.post(
|
|
77
43
|
this.Url.endpoint("create-order"),
|
|
78
44
|
{
|
|
79
|
-
body: JSON.stringify(
|
|
45
|
+
body: JSON.stringify(e),
|
|
80
46
|
headers: {
|
|
81
|
-
Authorization:
|
|
47
|
+
Authorization: O(t.val),
|
|
82
48
|
"Content-Type": "application/json"
|
|
83
49
|
}
|
|
84
50
|
}
|
|
85
51
|
);
|
|
86
|
-
return
|
|
87
|
-
} catch (
|
|
88
|
-
return
|
|
52
|
+
return r.error ? s(r.error) : r.result ? w(r.result) : s("CreateOrder: Unexpected error, result is undefined");
|
|
53
|
+
} catch (r) {
|
|
54
|
+
return s("CreateOrder:", String(r));
|
|
89
55
|
}
|
|
90
56
|
}
|
|
91
|
-
async fetchOrders(
|
|
92
|
-
var
|
|
93
|
-
const
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
57
|
+
async fetchOrders(e, t = !1, r) {
|
|
58
|
+
var n;
|
|
59
|
+
const a = (n = this.walletClient.account) == null ? void 0 : n.address;
|
|
60
|
+
return a ? e ? await super.getMatchedOrders(
|
|
61
|
+
a,
|
|
62
|
+
t,
|
|
63
|
+
r
|
|
98
64
|
) : await super.getUnMatchedOrders(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
) :
|
|
65
|
+
a,
|
|
66
|
+
r
|
|
67
|
+
) : s("Wallet client does not have an account");
|
|
102
68
|
}
|
|
103
69
|
/**
|
|
104
70
|
* Wrapper for the subscribeOrders method in the OrdersProvider class to abstract the address parameter.
|
|
@@ -108,38 +74,25 @@ class w extends C {
|
|
|
108
74
|
* @param paginationConfig - The configuration for the pagination
|
|
109
75
|
* @returns {() => void} A function to unsubscribe from the order updates
|
|
110
76
|
*/
|
|
111
|
-
async subscribeToOrders(t,
|
|
112
|
-
var
|
|
113
|
-
const
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
t,
|
|
77
|
+
async subscribeToOrders(e, t, r, a, n) {
|
|
78
|
+
var l;
|
|
79
|
+
const i = (l = this.walletClient.account) == null ? void 0 : l.address;
|
|
80
|
+
return i ? await super.subscribeOrders(
|
|
81
|
+
i,
|
|
117
82
|
e,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
83
|
+
t,
|
|
84
|
+
r,
|
|
85
|
+
a,
|
|
86
|
+
n
|
|
121
87
|
) : () => {
|
|
122
88
|
};
|
|
123
89
|
}
|
|
124
90
|
async getUserOrdersCount() {
|
|
125
|
-
var
|
|
126
|
-
const
|
|
127
|
-
return
|
|
128
|
-
}
|
|
129
|
-
validateConfig(t) {
|
|
130
|
-
const { sendAmount: e, receiveAmount: s, toAsset: n, fromAsset: i } = t;
|
|
131
|
-
if (n.atomicSwapAddress.toLowerCase() === i.atomicSwapAddress.toLowerCase() && n.chain === i.chain)
|
|
132
|
-
return r(c.SAME_ASSET);
|
|
133
|
-
if (!_(n.chain) && !n.atomicSwapAddress)
|
|
134
|
-
return r(c.INVALID_AS_ADDRESS);
|
|
135
|
-
if (!_(i.chain) && !i.atomicSwapAddress)
|
|
136
|
-
return r(c.INVALID_AS_ADDRESS);
|
|
137
|
-
if (!n.tokenAddress || !i.tokenAddress)
|
|
138
|
-
return r(c.INVALID_TOKEN);
|
|
139
|
-
const a = BigInt(e), o = BigInt(s);
|
|
140
|
-
return e == null || a <= 0n || e.includes(".") ? r(c.INVALID_SEND_AMOUNT) : s == null || o <= 0n || s.includes(".") ? r(c.INVALID_RECEIVE_AMOUNT) : a < o ? r(c.RECEIVE_AMOUNT_GREATER) : A(T);
|
|
91
|
+
var t;
|
|
92
|
+
const e = (t = this.walletClient.account) == null ? void 0 : t.address;
|
|
93
|
+
return e ? super.getOrdersCount(e) : s("Wallet client does not have an account");
|
|
141
94
|
}
|
|
142
95
|
}
|
|
143
96
|
export {
|
|
144
|
-
|
|
97
|
+
o as Orderbook
|
|
145
98
|
};
|
package/dist/index4.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@catalogfi/utils"),l=require("@gardenfi/utils"),d=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@catalogfi/utils"),l=require("@gardenfi/utils"),d=require("./index7.cjs");class O{constructor(s){this.url=new l.Url("/orders",s)}async getOrder(s,c){const t=c?`/id/matched/${s}`:`/id/unmatched/${s}`,n=this.url.endpoint(t);try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetOrder: Unexpected error, result is undefined")}catch(e){return r.Err("GetOrder:",String(e))}}async getMatchedOrders(s,c,t){const n=d.ConstructUrl(this.url,`/user/matched/${s}`,{...t,pending:c});try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetMatchedOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetMatchedOrders:",String(e))}}async getUnMatchedOrders(s,c){const t=d.ConstructUrl(this.url,`/user/unmatched/${s}`,c);try{const n=await r.Fetcher.get(t);return n.error?r.Err(n.error):n.result?r.Ok(n.result):r.Err("GetUnMatchedOrders: Unexpected error, result is undefined")}catch(n){return r.Err("GetUnMatchedOrders:",String(n))}}async getOrders(s,c){const t=s?"/matched":"/unmatched",n=d.ConstructUrl(this.url,t,c);try{const e=await r.Fetcher.get(n);return e.error?r.Err(e.error):e.result?r.Ok(e.result):r.Err("GetAllOrders: Unexpected error, result is undefined")}catch(e){return r.Err("GetAllOrders:",String(e))}}async subscribeOrders(s,c,t,n,e=!1,i){let o=!1;const a=async()=>{if(!o){o=!0;try{const u=c?await this.getMatchedOrders(s,e,i):await this.getUnMatchedOrders(s,i);u.ok?await n(u.val):console.error("Error fetching orders:",u.error)}catch(u){console.error("Error fetching orders:",u)}finally{o=!1}}};await a();const h=setInterval(a,t);return()=>{clearInterval(h)}}async getOrdersCount(s){const c=this.url.endpoint(`/user/count/${s}`);try{const t=await r.Fetcher.get(c);return t.error?r.Err(t.error):t.status===l.ApiStatus.Ok&&t.result!==void 0?r.Ok(t.result):r.Err("GetOrdersCount: Unexpected error, result is undefined")}catch(t){return r.Err("GetOrdersCount:",String(t))}}}exports.OrdersProvider=O;
|
package/dist/index4.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fetcher as u, Err as s, Ok as d } from "@catalogfi/utils";
|
|
2
2
|
import { Url as f, ApiStatus as g } from "@gardenfi/utils";
|
|
3
|
-
import { ConstructUrl as i } from "./
|
|
3
|
+
import { ConstructUrl as i } from "./index7.js";
|
|
4
4
|
class w {
|
|
5
5
|
constructor(t) {
|
|
6
6
|
this.url = new f("/orders", t);
|
package/dist/index6.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://api.garden.finance";exports.MAINNET_ORDERBOOK_API=e;
|
package/dist/index6.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
INVALID_SEND_AMOUNT: "invalid send amount",
|
|
3
|
-
INVALID_RECEIVE_AMOUNT: "invalid receive amount",
|
|
4
|
-
UNSUPPORTED_CHAIN: "unsupported chain",
|
|
5
|
-
SAME_ASSET: "cannot create orderpair with the same assets",
|
|
6
|
-
INVALID_AS_ADDRESS: "invalid atomic swap address",
|
|
7
|
-
INVALID_TOKEN: "invalid token address",
|
|
8
|
-
INVALID_AMOUNTS: "invalid amounts",
|
|
9
|
-
RECEIVE_AMOUNT_GREATER: "receive amount is greater than send amount"
|
|
10
|
-
};
|
|
1
|
+
const n = "https://api.garden.finance";
|
|
11
2
|
export {
|
|
12
|
-
|
|
3
|
+
n as MAINNET_ORDERBOOK_API
|
|
13
4
|
};
|
package/dist/index7.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=(n,o,t)=>{const r=n.endpoint(o);return t&&Object.entries(t).forEach(([c,e])=>{e!==void 0&&r.searchParams.append(c,e.toString())}),r};exports.ConstructUrl=i;
|
package/dist/index7.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = (o, e, t) => {
|
|
2
|
+
const r = o.endpoint(e);
|
|
3
|
+
return t && Object.entries(t).forEach(([c, n]) => {
|
|
4
|
+
n !== void 0 && r.searchParams.append(c, n.toString());
|
|
5
|
+
}), r;
|
|
6
|
+
};
|
|
2
7
|
export {
|
|
3
|
-
|
|
8
|
+
i as ConstructUrl
|
|
4
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncResult } from '@catalogfi/utils';
|
|
2
|
-
import { CreateOrder,
|
|
2
|
+
import { CreateOrder, CreateOrderRequestWithAdditionalData, IOrderbook, MatchedOrder, OrderbookConfig, PaginatedData, PaginationConfig } from './orderbook.types';
|
|
3
3
|
import { OrdersProvider } from '../orders/ordersProvider';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -28,7 +28,7 @@ export declare class Orderbook extends OrdersProvider implements IOrderbook {
|
|
|
28
28
|
* @param {CreateOrderConfig} createOrderConfig - The configuration for the creating the order.
|
|
29
29
|
* @returns {string} The create order ID.
|
|
30
30
|
*/
|
|
31
|
-
createOrder(
|
|
31
|
+
createOrder(order: CreateOrderRequestWithAdditionalData): AsyncResult<string, string>;
|
|
32
32
|
fetchOrders<T extends boolean>(matched: T, pending?: boolean, paginationConfig?: PaginationConfig): AsyncResult<PaginatedData<T extends true ? MatchedOrder : CreateOrder>, string>;
|
|
33
33
|
/**
|
|
34
34
|
* Wrapper for the subscribeOrders method in the OrdersProvider class to abstract the address parameter.
|
|
@@ -40,5 +40,4 @@ export declare class Orderbook extends OrdersProvider implements IOrderbook {
|
|
|
40
40
|
*/
|
|
41
41
|
subscribeToOrders<T extends boolean>(matched: T, interval: number, cb: (orders: PaginatedData<T extends true ? MatchedOrder : CreateOrder>) => Promise<void>, pending?: boolean, paginationConfig?: PaginationConfig): Promise<() => void>;
|
|
42
42
|
getUserOrdersCount(): AsyncResult<number, string>;
|
|
43
|
-
private validateConfig;
|
|
44
43
|
}
|
|
@@ -99,7 +99,7 @@ export interface IOrderbook extends IOrderProvider {
|
|
|
99
99
|
* @param {CreateOrderConfig} orderConfig - The configuration for the creating the order.
|
|
100
100
|
* @returns {number} The create order ID.
|
|
101
101
|
*/
|
|
102
|
-
createOrder(
|
|
102
|
+
createOrder(order: CreateOrderRequestWithAdditionalData): AsyncResult<string, string>;
|
|
103
103
|
/**
|
|
104
104
|
* Wrapper for the getOrder method in the OrdersProvider class to abstract the address parameter.
|
|
105
105
|
* @param matched - Whether to get matched or unmatched orders
|
|
@@ -132,6 +132,25 @@ export type Orders = {
|
|
|
132
132
|
unmatched: PaginatedData<CreateOrder[]>;
|
|
133
133
|
matched: PaginatedData<MatchedOrder[]>;
|
|
134
134
|
};
|
|
135
|
+
export type AdditionalData = {
|
|
136
|
+
additional_data: {
|
|
137
|
+
strategy_id: string;
|
|
138
|
+
sig: string;
|
|
139
|
+
input_token_price: number;
|
|
140
|
+
output_token_price: number;
|
|
141
|
+
deadline: string;
|
|
142
|
+
bitcoin_optional_recipient?: string;
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export type AdditionalDataWithStrategyId = {
|
|
147
|
+
additional_data: {
|
|
148
|
+
strategy_id: string;
|
|
149
|
+
bitcoin_optional_recipient?: string;
|
|
150
|
+
[key: string]: any;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
export type CreateOrderReqWithStrategyId = CreateOrderRequest & AdditionalDataWithStrategyId;
|
|
135
154
|
export type CreateOrderRequest = {
|
|
136
155
|
source_chain: string;
|
|
137
156
|
destination_chain: string;
|
|
@@ -146,11 +165,9 @@ export type CreateOrderRequest = {
|
|
|
146
165
|
min_destination_confirmations: number;
|
|
147
166
|
timelock: number;
|
|
148
167
|
secret_hash: string;
|
|
149
|
-
additional_data?: {
|
|
150
|
-
bitcoin_optional_recipient: string;
|
|
151
|
-
};
|
|
152
168
|
};
|
|
153
|
-
export type
|
|
169
|
+
export type CreateOrderRequestWithAdditionalData = CreateOrderRequest & AdditionalData;
|
|
170
|
+
export type CreateOrder = CreateOrderRequestWithAdditionalData & {
|
|
154
171
|
created_at: string;
|
|
155
172
|
updated_at: string;
|
|
156
173
|
deleted_at: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/orderbook",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@catalogfi/utils": "^0.1.6",
|
|
30
30
|
"@catalogfi/wallets": "0.2.43",
|
|
31
|
-
"@gardenfi/utils": "^0.0.1-beta.
|
|
31
|
+
"@gardenfi/utils": "^0.0.1-beta.4",
|
|
32
32
|
"bufferutil": "^4.0.8",
|
|
33
33
|
"siwe": "^2.1.4",
|
|
34
34
|
"utf-8-validate": "^6.0.3",
|
package/dist/index8.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=(n,o,t)=>{const r=n.endpoint(o);return t&&Object.entries(t).forEach(([c,e])=>{e!==void 0&&r.searchParams.append(c,e.toString())}),r};exports.ConstructUrl=i;
|