Skip to content

Commit

Permalink
Add supported screening assets route (#259)
Browse files Browse the repository at this point in the history
* Add supporte screening assets route

* Remove unused import

* Remove an empty line from ScreeningSupportedProviders enum
  • Loading branch information
rade-fireblocks authored Mar 5, 2024
1 parent 3699704 commit 3b3880f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ import {
TokenLinkStatus,
SupportedContractTemplateType,
AbiFunction,
TokenOwnershipSpamUpdatePayload,
TokenOwnershipSpamUpdatePayload, ScreeningSupportedAssetResponse, ScreeningSupportedProviders,
} from "./types";
import { AxiosProxyConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
import { PIIEncryption } from "./pii-client";
Expand Down Expand Up @@ -2096,7 +2096,7 @@ export class FireblocksSDK {
* Get PostScreening Policies for compliance
* @param screeningType The type of screening (e.g., 'travel_rule', 'aml')
*/
private async getPostScreeningPolicy(screeningType: ScreeningType): Promise<ScreeningProviderConfigurationResponse> {
public async getPostScreeningPolicy(screeningType: ScreeningType): Promise<ScreeningProviderConfigurationResponse> {
const endpoint = `/v1/screening/${screeningType}/post_screening_policy`;
return await this.apiClient.issueGetRequest(endpoint);
}
Expand All @@ -2105,7 +2105,7 @@ export class FireblocksSDK {
* Get Screening Policies for compliance
* @param screeningType The type of screening (e.g., 'travel_rule', 'aml')
*/
private async getScreeningPolicy(screeningType: ScreeningType): Promise<ScreeningPolicyRuleResponse> {
public async getScreeningPolicy(screeningType: ScreeningType): Promise<ScreeningPolicyRuleResponse> {
const endpoint = `/v1/screening/${screeningType}/screening_policy`;
return await this.apiClient.issueGetRequest(endpoint);
}
Expand All @@ -2114,7 +2114,7 @@ export class FireblocksSDK {
* Get Screening Configuration for compliance
* @param screeningType The type of screening (e.g., 'travel_rule', 'aml')
*/
private async getScreeningConfiguration(screeningType: ScreeningType): Promise<ScreeningConfigurationsResponse> {
public async getScreeningConfiguration(screeningType: ScreeningType): Promise<ScreeningConfigurationsResponse> {
const endpoint = `/v1/screening/${screeningType}/policy_configuration`;
return await this.apiClient.issueGetRequest(endpoint);
}
Expand All @@ -2124,7 +2124,7 @@ export class FireblocksSDK {
* @param screeningType The type of screening (e.g., 'travel_rule', 'aml')
* @param screeningPolicyConfiguration The configuration to update
*/
private async updatePolicyConfiguration(screeningType: ScreeningType, screeningPolicyConfiguration: ScreeningPolicyConfiguration): Promise<ScreeningConfigurationsResponse> {
public async updatePolicyConfiguration(screeningType: ScreeningType, screeningPolicyConfiguration: ScreeningPolicyConfiguration): Promise<ScreeningConfigurationsResponse> {
const endpoint = `/v1/screening/${screeningType}/policy_configuration`;
return await this.apiClient.issuePutRequest(endpoint, screeningPolicyConfiguration);
}
Expand All @@ -2137,6 +2137,14 @@ export class FireblocksSDK {
return await this.apiClient.issuePutRequest(`/v1/screening/config`, screeningTenantConfiguration);
}

/**
* Get supported assets for screening per provider
* @param provider The provider to get supported assets for
*/
public async getSupportedAssetsForScreening(provider: ScreeningSupportedProviders): Promise<ScreeningSupportedAssetResponse> {
return await this.apiClient.issueGetRequest(`/v1/screening/supported_assets/:${provider}`);
}

/**
* Creates Smart Transfers ticket
* @param data
Expand Down
17 changes: 17 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,23 @@ export interface ScreeningPolicyRuleResponse {

export type ScreeningType = "travel_rule" | "aml";

export interface ScreeningSupportedAssetResponse {
id: string;
name: string;
type: string;
contractAddress: string;
nativeAsset: string;
decimals?: number;
blockchain: string;
}

export enum ScreeningSupportedProviders {
CHAINALYSIS = "CHAINALYSIS",
ELLIPTIC = "ELLIPTIC",
CHAINALYSIS_V2 = "CHAINALYSIS_V2",
ELLIPTIC_HOLISTIC = "ELLIPTIC_HOLISTIC",
}

export enum Web3ConnectionFeeLevel {
HIGH = "HIGH",
MEDIUM = "MEDIUM",
Expand Down

0 comments on commit 3b3880f

Please sign in to comment.