From 3b3880f571834258771a6f92f06a5c2e4f919465 Mon Sep 17 00:00:00 2001 From: rade-fireblocks <129152277+rade-fireblocks@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:09:21 +0100 Subject: [PATCH] Add supported screening assets route (#259) * Add supporte screening assets route * Remove unused import * Remove an empty line from ScreeningSupportedProviders enum --- src/fireblocks-sdk.ts | 18 +++++++++++++----- src/types.ts | 17 +++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/fireblocks-sdk.ts b/src/fireblocks-sdk.ts index 3822d23a..2d0bcb4e 100644 --- a/src/fireblocks-sdk.ts +++ b/src/fireblocks-sdk.ts @@ -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"; @@ -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 { + public async getPostScreeningPolicy(screeningType: ScreeningType): Promise { const endpoint = `/v1/screening/${screeningType}/post_screening_policy`; return await this.apiClient.issueGetRequest(endpoint); } @@ -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 { + public async getScreeningPolicy(screeningType: ScreeningType): Promise { const endpoint = `/v1/screening/${screeningType}/screening_policy`; return await this.apiClient.issueGetRequest(endpoint); } @@ -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 { + public async getScreeningConfiguration(screeningType: ScreeningType): Promise { const endpoint = `/v1/screening/${screeningType}/policy_configuration`; return await this.apiClient.issueGetRequest(endpoint); } @@ -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 { + public async updatePolicyConfiguration(screeningType: ScreeningType, screeningPolicyConfiguration: ScreeningPolicyConfiguration): Promise { const endpoint = `/v1/screening/${screeningType}/policy_configuration`; return await this.apiClient.issuePutRequest(endpoint, screeningPolicyConfiguration); } @@ -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 { + return await this.apiClient.issueGetRequest(`/v1/screening/supported_assets/:${provider}`); + } + /** * Creates Smart Transfers ticket * @param data diff --git a/src/types.ts b/src/types.ts index ff1f7527..fc5274dc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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",