swaply-sdk-ts 0.0.21 → 0.0.22

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.
@@ -8,7 +8,7 @@ export declare class SwaplyApiClient {
8
8
  addApproval(signedData: SignedApproval, intentId: string): Promise<void>;
9
9
  getIntent(intentId: string): Promise<PublicSwapWithAdditionalInfo>;
10
10
  getIntentStatus(intentId: string): Promise<IntentStatus>;
11
- listRetailUserHistory(walletAddressOrRetailId: string): Promise<PaginatedResponse<PublicSwapWithAdditionalInfo>>;
11
+ listRetailUserHistory(walletAddressOrRetailId: string, limit?: number, offset?: number, active?: boolean): Promise<PaginatedResponse<PublicSwapWithAdditionalInfo>>;
12
12
  getSwapByIntentId(intentId: string): Promise<PublicSwapWithAdditionalInfo>;
13
13
  listNetworks(token?: string): Promise<Network[]>;
14
14
  listTokens(limit?: number, offset?: number, q?: string, networkId?: number): Promise<PaginatedResponse<Token>>;
package/dist/apiClient.js CHANGED
@@ -46,8 +46,8 @@ export class SwaplyApiClient {
46
46
  const response = await this.client.get(`/intents/${intentId}/status`);
47
47
  return response.data.status;
48
48
  }
49
- async listRetailUserHistory(walletAddressOrRetailId) {
50
- const response = await this.client.get(`/history/${walletAddressOrRetailId}`);
49
+ async listRetailUserHistory(walletAddressOrRetailId, limit = 20, offset = 0, active = false) {
50
+ const response = await this.client.get(`/history/${walletAddressOrRetailId}?limit=${limit}&offset=${offset}&active=${active}`);
51
51
  return response.data;
52
52
  }
53
53
  async getSwapByIntentId(intentId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swaply-sdk-ts",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist",
package/src/apiClient.ts CHANGED
@@ -97,9 +97,14 @@ export class SwaplyApiClient {
97
97
 
98
98
  async listRetailUserHistory(
99
99
  walletAddressOrRetailId: string,
100
+ limit: number = 20,
101
+ offset: number = 0,
102
+ active: boolean = false,
100
103
  ): Promise<PaginatedResponse<PublicSwapWithAdditionalInfo>> {
101
104
  const response: AxiosResponse<PaginatedResponse<PublicSwapWithAdditionalInfo>> =
102
- await this.client.get(`/history/${walletAddressOrRetailId}`);
105
+ await this.client.get(
106
+ `/history/${walletAddressOrRetailId}?limit=${limit}&offset=${offset}&active=${active}`,
107
+ );
103
108
 
104
109
  return response.data;
105
110
  }
package/tsconfig.json CHANGED
@@ -28,5 +28,4 @@
28
28
  "declarationDir": "./dist",
29
29
  },
30
30
  "include": ["src"],
31
- "exclude": ["node_modules"],
32
31
  }