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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velora-dex/sdk",
3
- "version": "9.2.0-dev.0",
3
+ "version": "9.3.0-dev.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/sdk.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -49,19 +49,19 @@
49
49
  }
50
50
  ],
51
51
  "devDependencies": {
52
- "@size-limit/preset-small-lib": "^11.1.6",
52
+ "@size-limit/preset-small-lib": "^12.0.0",
53
53
  "@tsconfig/recommended": "^1.0.8",
54
- "axios": "^1.7.7",
54
+ "axios": "^1.13.2",
55
55
  "bignumber.js": "^9.1.2",
56
56
  "dotenv": "^16.4.5",
57
57
  "dts-cli": "^2.0.5",
58
58
  "ethers": "^6.13.4",
59
59
  "ethersV5": "npm:ethers@5",
60
- "hardhat": "^2.22.15",
61
- "hardhat-switch-network": "^1.1.1",
60
+ "hardhat": "^2.28.0",
61
+ "hardhat-switch-network": "^1.2.1",
62
62
  "husky": "^9.1.6",
63
63
  "isomorphic-unfetch": "^4.0.2",
64
- "size-limit": "^11.1.6",
64
+ "size-limit": "^12.0.0",
65
65
  "tslib": "^2.8.1",
66
66
  "typedoc": "^0.26.11",
67
67
  "typedoc-plugin-markdown": "^4.2.10",
@@ -7,7 +7,7 @@ import type {
7
7
  } from '../../types';
8
8
  import type { DeltaAuction, DeltaAuctionStatus } from './helpers/types';
9
9
 
10
- export type DeltaOrderFromAPI = Omit<DeltaAuction, 'signature'>;
10
+ export type DeltaOrderFromAPI = Omit<DeltaAuction, 'signature' | 'cosignature'>;
11
11
 
12
12
  export type DeltaOrderFilterByStatus =
13
13
  | DeltaAuctionStatus
@@ -35,15 +35,22 @@ export type DeltaPriceParams = {
35
35
 
36
36
  includeAgents?: string[];
37
37
  excludeAgents?: string[];
38
+ includeBridges?: string[];
39
+ excludeBridges?: string[];
40
+
41
+ /** @description Allow swap on destChain after bridge. Default is true. */
42
+ allowBridgeSwap?: boolean;
38
43
  };
39
44
 
40
45
  type DeltaPriceQueryOptions = Omit<
41
46
  DeltaPriceParams,
42
- 'includeAgents' | 'excludeAgents'
47
+ 'includeAgents' | 'excludeAgents' | 'includeBridges' | 'excludeBridges'
43
48
  > & {
44
49
  chainId: number; // will return error from API on unsupported chains
45
50
  includeAgents?: string;
46
51
  excludeAgents?: string;
52
+ includeBridges?: string;
53
+ excludeBridges?: string;
47
54
  };
48
55
 
49
56
  // for same-chain Orders, all 0 params
@@ -164,13 +171,25 @@ export const constructGetDeltaPrice = ({
164
171
  options: DeltaPriceParams,
165
172
  requestParams?: RequestParameters
166
173
  ): Promise<DeltaPrice | BridgePrice> {
167
- const { includeAgents, excludeAgents, ...rest } = options;
174
+ const {
175
+ includeAgents,
176
+ excludeAgents,
177
+ includeBridges,
178
+ excludeBridges,
179
+ ...rest
180
+ } = options;
168
181
  const includeAgentsString = includeAgents
169
182
  ? includeAgents.join(',')
170
183
  : undefined;
171
184
  const excludeAgentsString = excludeAgents
172
185
  ? excludeAgents.join(',')
173
186
  : undefined;
187
+ const includeBridgesString = includeBridges
188
+ ? includeBridges.join(',')
189
+ : undefined;
190
+ const excludeBridgesString = excludeBridges
191
+ ? excludeBridges.join(',')
192
+ : undefined;
174
193
 
175
194
  const search = constructSearchString<DeltaPriceQueryOptions>({
176
195
  ...rest,
@@ -178,6 +197,8 @@ export const constructGetDeltaPrice = ({
178
197
  side: options.side ?? SwapSide.SELL,
179
198
  includeAgents: includeAgentsString,
180
199
  excludeAgents: excludeAgentsString,
200
+ includeBridges: includeBridgesString,
201
+ excludeBridges: excludeBridgesString,
181
202
  });
182
203
 
183
204
  const fetchURL = `${pricesUrl}/${search}` as const;
@@ -95,6 +95,7 @@ export type DeltaAuction = {
95
95
  deltaVersion: string; // 1.0 or 2.0 currently
96
96
  user: string;
97
97
  signature: string;
98
+ cosignature: string; // added for Crosschain Orders after bridge
98
99
  status: DeltaAuctionStatus;
99
100
  order: DeltaAuctionOrder;
100
101
  orderHash: string | null; // not available on old Orders only
@@ -27,6 +27,7 @@ export type DeltaOrderApiResponse = Omit<DeltaAuction, 'transactions'> & {
27
27
  orderVersion: string; // "2.0.0"
28
28
  deltaGasOverhead: number; // @TODO may be removed
29
29
  type: 'MARKET' | 'LIMIT';
30
+ cosignature: '0x';
30
31
  };
31
32
 
32
33
  type PostDeltaOrder = (
@@ -9,9 +9,10 @@ import {
9
9
  SignableDeltaOrderData,
10
10
  } from './helpers/buildDeltaOrderData';
11
11
  import { sanitizeDeltaOrderData } from './helpers/misc';
12
- import { constructGetDeltaContract, DeltaAuctionOrder } from '../..';
13
- import { ExtractAbiMethodNames } from '../../helpers/misc';
12
+ import type { ExtractAbiMethodNames } from '../../helpers/misc';
14
13
  import { findPrimaryType } from '../../helpers/providers/helpers';
14
+ import { constructGetDeltaContract } from './getDeltaContract';
15
+ import type { DeltaAuctionOrder } from './helpers/types';
15
16
 
16
17
  type HashDeltaOrderTypedData = (
17
18
  signableOrderData: SignableDeltaOrderData