File tree 2 files changed +40
-1
lines changed
2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 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
}
Original file line number Diff line number Diff line change @@ -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 ------------ //
You can’t perform that action at this time.
0 commit comments