@velora-dex/sdk 9.2.0 → 9.3.0-dev.1

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/sdk.esm.js CHANGED
@@ -4053,7 +4053,7 @@ function produceDeltaOrderHash(typedData) {
4053
4053
  });
4054
4054
  }
4055
4055
 
4056
- var _excluded = ["includeAgents", "excludeAgents"];
4056
+ var _excluded = ["includeAgents", "excludeAgents", "includeBridges", "excludeBridges"];
4057
4057
  var constructGetDeltaPrice = function constructGetDeltaPrice(_ref) {
4058
4058
  var _ref$apiURL = _ref.apiURL,
4059
4059
  apiURL = _ref$apiURL === void 0 ? API_URL : _ref$apiURL,
@@ -4066,30 +4066,34 @@ var constructGetDeltaPrice = function constructGetDeltaPrice(_ref) {
4066
4066
  function _getDeltaPrice() {
4067
4067
  _getDeltaPrice = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(options, requestParams) {
4068
4068
  var _options$side;
4069
- var includeAgents, excludeAgents, rest, includeAgentsString, excludeAgentsString, search, fetchURL, data;
4069
+ var includeAgents, excludeAgents, includeBridges, excludeBridges, rest, includeAgentsString, excludeAgentsString, includeBridgesString, excludeBridgesString, search, fetchURL, data;
4070
4070
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4071
4071
  while (1) switch (_context.prev = _context.next) {
4072
4072
  case 0:
4073
- includeAgents = options.includeAgents, excludeAgents = options.excludeAgents, rest = _objectWithoutPropertiesLoose(options, _excluded);
4073
+ includeAgents = options.includeAgents, excludeAgents = options.excludeAgents, includeBridges = options.includeBridges, excludeBridges = options.excludeBridges, rest = _objectWithoutPropertiesLoose(options, _excluded);
4074
4074
  includeAgentsString = includeAgents ? includeAgents.join(',') : undefined;
4075
4075
  excludeAgentsString = excludeAgents ? excludeAgents.join(',') : undefined;
4076
+ includeBridgesString = includeBridges ? includeBridges.join(',') : undefined;
4077
+ excludeBridgesString = excludeBridges ? excludeBridges.join(',') : undefined;
4076
4078
  search = constructSearchString(_extends({}, rest, {
4077
4079
  chainId: chainId,
4078
4080
  side: (_options$side = options.side) != null ? _options$side : SwapSide.SELL,
4079
4081
  includeAgents: includeAgentsString,
4080
- excludeAgents: excludeAgentsString
4082
+ excludeAgents: excludeAgentsString,
4083
+ includeBridges: includeBridgesString,
4084
+ excludeBridges: excludeBridgesString
4081
4085
  }));
4082
4086
  fetchURL = pricesUrl + "/" + search;
4083
- _context.next = 7;
4087
+ _context.next = 9;
4084
4088
  return fetcher({
4085
4089
  url: fetchURL,
4086
4090
  method: 'GET',
4087
4091
  requestParams: requestParams
4088
4092
  });
4089
- case 7:
4093
+ case 9:
4090
4094
  data = _context.sent;
4091
4095
  return _context.abrupt("return", data.price);
4092
- case 9:
4096
+ case 11:
4093
4097
  case "end":
4094
4098
  return _context.stop();
4095
4099
  }
@@ -4276,34 +4280,72 @@ var constructGetBridgeInfo = function constructGetBridgeInfo(_ref) {
4276
4280
  var _ref$apiURL = _ref.apiURL,
4277
4281
  apiURL = _ref$apiURL === void 0 ? API_URL : _ref$apiURL,
4278
4282
  fetcher = _ref.fetcher;
4279
- var bridgeInfoUrl = apiURL + "/delta/prices/bridge-info";
4283
+ var deltaBridgeUrl = apiURL + "/delta/prices";
4280
4284
  var getBridgeInfo = /*#__PURE__*/function () {
4281
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(requestParams) {
4282
- var data;
4285
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, requestParams) {
4286
+ var _params, allowBridgeAndSwap, bridges, allowBridgeAndSwapString, bridgesString, search, fetchURL, data;
4283
4287
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4284
4288
  while (1) switch (_context.prev = _context.next) {
4285
4289
  case 0:
4286
- _context.next = 2;
4290
+ if (params === void 0) {
4291
+ params = {};
4292
+ }
4293
+ _params = params, allowBridgeAndSwap = _params.allowBridgeAndSwap, bridges = _params.bridges;
4294
+ allowBridgeAndSwapString = allowBridgeAndSwap ? 'true' : 'false';
4295
+ bridgesString = bridges ? bridges.join(',') : undefined;
4296
+ search = constructSearchString({
4297
+ allowBridgeAndSwap: allowBridgeAndSwapString,
4298
+ bridges: bridgesString
4299
+ });
4300
+ fetchURL = deltaBridgeUrl + "/bridge-info" + search;
4301
+ _context.next = 8;
4287
4302
  return fetcher({
4288
- url: bridgeInfoUrl,
4303
+ url: fetchURL,
4289
4304
  method: 'GET',
4290
4305
  requestParams: requestParams
4291
4306
  });
4292
- case 2:
4307
+ case 8:
4293
4308
  data = _context.sent;
4294
4309
  return _context.abrupt("return", data.supportedTokens);
4295
- case 4:
4310
+ case 10:
4296
4311
  case "end":
4297
4312
  return _context.stop();
4298
4313
  }
4299
4314
  }, _callee);
4300
4315
  }));
4301
- return function getBridgeInfo(_x) {
4316
+ return function getBridgeInfo(_x, _x2) {
4302
4317
  return _ref2.apply(this, arguments);
4303
4318
  };
4304
4319
  }();
4320
+ var getBridgeProtocols = /*#__PURE__*/function () {
4321
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(requestParams) {
4322
+ var fetchURL, data;
4323
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4324
+ while (1) switch (_context2.prev = _context2.next) {
4325
+ case 0:
4326
+ fetchURL = deltaBridgeUrl + "/bridge-protocols";
4327
+ _context2.next = 3;
4328
+ return fetcher({
4329
+ url: fetchURL,
4330
+ method: 'GET',
4331
+ requestParams: requestParams
4332
+ });
4333
+ case 3:
4334
+ data = _context2.sent;
4335
+ return _context2.abrupt("return", data.bridgeProtocols);
4336
+ case 5:
4337
+ case "end":
4338
+ return _context2.stop();
4339
+ }
4340
+ }, _callee2);
4341
+ }));
4342
+ return function getBridgeProtocols(_x3) {
4343
+ return _ref3.apply(this, arguments);
4344
+ };
4345
+ }();
4305
4346
  return {
4306
- getBridgeInfo: getBridgeInfo
4347
+ getBridgeInfo: getBridgeInfo,
4348
+ getBridgeProtocols: getBridgeProtocols
4307
4349
  };
4308
4350
  };
4309
4351