@1stdex/first-sdk 1.0.76 → 1.0.78

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.
@@ -1,13 +1,13 @@
1
1
  import { CHAIN_IDS } from '../../../constants/chain-configs/chain';
2
2
  import type { TradeHistoryResult } from '../types';
3
3
  /**
4
- * Fetch trade history for a user from the subgraph
4
+ * Fetch trade history from the subgraph
5
5
  * @param chainId - chain id from {@link CHAIN_IDS}
6
- * @param userAddress - The Ethereum address of the user
6
+ * @param userAddress - Optional. The Ethereum address of the user. If provided, only returns trades for this user.
7
7
  * @param options - Optional parameters for filtering and pagination
8
8
  * @returns Trade history with pagination info
9
9
  */
10
- export declare function fetchTradeHistoryFromSubgraph(chainId: CHAIN_IDS, userAddress: `0x${string}`, options?: {
10
+ export declare function fetchTradeHistoryFromSubgraph(chainId: CHAIN_IDS, userAddress?: `0x${string}`, options?: {
11
11
  tokenAddresses?: `0x${string}`[];
12
12
  limit?: number | undefined;
13
13
  cursor?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/entities/trade/apis/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAInE,OAAO,KAAK,EAAS,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAyF1D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,KAAK,MAAM,EAAE,EAC1B,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,GACA,OAAO,CAAC,kBAAkB,CAAC,CA6G7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/entities/trade/apis/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAInE,OAAO,KAAK,EAAS,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA+H1D;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,SAAS,EAClB,WAAW,CAAC,EAAE,KAAK,MAAM,EAAE,EAC3B,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,GACA,OAAO,CAAC,kBAAkB,CAAC,CAiI7B"}
@@ -7,6 +7,8 @@ export type Trade = {
7
7
  taken: CurrencyFlow;
8
8
  timestamp: number;
9
9
  txHash: `0x${string}`;
10
+ logIndex: number;
11
+ bookId: string;
10
12
  };
11
13
  export type TradeHistoryResult = {
12
14
  trades: Trade[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/entities/trade/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE;QACR,WAAW,EAAE,OAAO,CAAC;QACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;CACH,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/entities/trade/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE;QACR,WAAW,EAAE,OAAO,CAAC;QACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;CACH,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { CHAIN_IDS } from '../constants/chain-configs/chain';
2
2
  import { TradeHistoryResult } from '../entities/trade/types';
3
3
  /**
4
- * Retrieves trade history for the specified user on the given chain.
4
+ * Retrieves trade history on the given chain.
5
5
  *
6
6
  * @param {CHAIN_IDS} chainId The chain ID.
7
- * @param {`0x${string}`} userAddress The Ethereum address of the user.
7
+ * @param {`0x${string}`} userAddress Optional. The Ethereum address of the user. If provided, only returns trades for this user.
8
8
  * @param {`0x${string}`[]} tokenAddresses Optional. Filter trades where any of these addresses is either input or output token. If empty array or undefined, no filtering is applied.
9
9
  * @param {number} limit Optional. Maximum number of trades to return per page (default: 50).
10
10
  * @param {string} cursor Optional. Pagination cursor (timestamp) to fetch trades older than this cursor.
@@ -30,10 +30,15 @@ import { TradeHistoryResult } from '../entities/trade/types';
30
30
  * userAddress: '0x5F79EE8f8fA862E98201120d83c4eC39D9468D49',
31
31
  * tokenAddresses: ['0x036CbD53842c5426634e7929541eC2318f3dCF7e']
32
32
  * })
33
+ *
34
+ * // Get all trades (no user filter)
35
+ * const allTrades = await getTradeHistory({
36
+ * chainId: 421614
37
+ * })
33
38
  */
34
39
  export declare const getTradeHistory: ({ chainId, userAddress, tokenAddresses, limit, cursor, }: {
35
40
  chainId: CHAIN_IDS;
36
- userAddress: `0x${string}`;
41
+ userAddress?: `0x${string}`;
37
42
  tokenAddresses?: `0x${string}`[];
38
43
  limit?: number;
39
44
  cursor?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"trade-history.d.ts","sourceRoot":"","sources":["../../../src/views/trade-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,eAAe,6DAMzB;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KAAG,QAAQ,kBAAkB,CAM7B,CAAC"}
1
+ {"version":3,"file":"trade-history.d.ts","sourceRoot":"","sources":["../../../src/views/trade-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,eAAe,6DAMzB;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,KAAG,QAAQ,kBAAkB,CAM7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1stdex/first-sdk",
3
- "version": "1.0.76",
3
+ "version": "1.0.78",
4
4
  "description": "🛠 An SDK for building applications on top of 1st V2",
5
5
  "files": [
6
6
  "dist"