Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supported screening assets route #259

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading