@dydxprotocol/v4-client-js 1.16.2 → 1.17.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": "@dydxprotocol/v4-client-js",
3
- "version": "1.16.2",
3
+ "version": "1.17.0",
4
4
  "description": "General client library for the new dYdX system (v4 decentralized)",
5
5
  "main": "build/src/index.js",
6
6
  "scripts": {
@@ -265,6 +265,7 @@ export default class AccountClient extends RestClient {
265
265
  });
266
266
  }
267
267
 
268
+ // limit applies to the subaccount ticks, so expect number of results to be much lower than limit
268
269
  async getParentSubaccountNumberHistoricalPNLs(
269
270
  address: string,
270
271
  parentSubaccountNumber: number,
@@ -1,4 +1,9 @@
1
- import type { ComplianceResponse, HeightResponse, TimeResponse } from '../types';
1
+ import type {
2
+ ComplianceResponse,
3
+ ComplianceV2Response,
4
+ HeightResponse,
5
+ TimeResponse,
6
+ } from '../types';
2
7
  import RestClient from './rest';
3
8
 
4
9
  export default class UtilityClient extends RestClient {
@@ -29,4 +34,14 @@ export default class UtilityClient extends RestClient {
29
34
  const uri = '/v4/screen';
30
35
  return this.get(uri, { address });
31
36
  }
37
+
38
+ /**
39
+ * @description Screen an address to see if it is restricted
40
+ * @param {string} address evm or dydx address
41
+ * @returns {ComplianceResponse} whether the specified address is restricted
42
+ */
43
+ async complianceScreen(address: string): Promise<ComplianceV2Response> {
44
+ const uri = `/v4/compliance/screen/${address}`;
45
+ return this.get(uri);
46
+ }
32
47
  }
@@ -105,6 +105,30 @@ export interface HeightResponse {
105
105
 
106
106
  export interface ComplianceResponse {
107
107
  restricted: boolean;
108
+ reason?: string;
109
+ }
110
+
111
+ export enum ComplianceReason {
112
+ MANUAL = 'MANUAL',
113
+ US_GEO = 'US_GEO',
114
+ CA_GEO = 'CA_GEO',
115
+ GB_GEO = 'GB_GEO',
116
+ SANCTIONED_GEO = 'SANCTIONED_GEO',
117
+ COMPLIANCE_PROVIDER = 'COMPLIANCE_PROVIDER',
118
+ }
119
+
120
+ export enum ComplianceStatus {
121
+ COMPLIANT = 'COMPLIANT',
122
+ FIRST_STRIKE_CLOSE_ONLY = 'FIRST_STRIKE_CLOSE_ONLY',
123
+ FIRST_STRIKE = 'FIRST_STRIKE',
124
+ CLOSE_ONLY = 'CLOSE_ONLY',
125
+ BLOCKED = 'BLOCKED',
126
+ }
127
+
128
+ export interface ComplianceV2Response {
129
+ status: ComplianceStatus;
130
+ reason?: ComplianceReason;
131
+ updatedAt?: string;
108
132
  }
109
133
 
110
134
  // ------------ Squid ------------ //