Skip to content

Commit

Permalink
Travel Rule Configuration and Policy routes (#187)
Browse files Browse the repository at this point in the history
* Feat: Travel Rule Configuration and Policy routes

* Exposing external Travel Rule endpoints

View TR screening and post/screening policy

Bypass screening during service outages.

Inbound transaction delay

Outbound transaction delay

* Update path and method naming

* Update paths remove unecessary braces

* Unify Update Screening Policy configuration endpoints add interfaces

* Rename paramethar for Screening Policy configuration

* Update JS doc for updateTravelRulePolicyConfiguration parameter description

* Fix update screening policy update URL

* Add undescore on Update url

* remove duplicate import
  • Loading branch information
rade-fireblocks authored Sep 19, 2023
1 parent 1ed64f6 commit ea9c931
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ import {
SmartTransfersTicketsFilters,
SmartTransfersTicketTermPayload,
SmartTransfersTicketTermFundPayload,
ScreeningPolicyConfiguration,
TravelRulePolicy,
TravelRuleRulesConfiguration,
SmartTransfersTicketTermResponse,
SmartTransfersUserGroupsResponse,
UsersGroup,
Expand Down Expand Up @@ -1679,6 +1682,35 @@ export class FireblocksSDK {
return await this.apiClient.issuePutRequest(`/v1/screening/travel-rule/vasp/update`, vaspInfo);
}

/**
* Get PostScreening Policies for travel rule compliance
*/
public async getTravelRulePostScreeningPolicy(): Promise<TravelRuleRulesConfiguration> {
return await this.apiClient.issueGetRequest(`/v1/screening/travel_rule/post_screening_policy`);
}

/**
* Get Screening Policies for travel rule compliance
*/
public async getTravelRuleScreeningPolicy(): Promise<TravelRulePolicy> {
return await this.apiClient.issueGetRequest(`/v1/screening/travel_rule/screening_policy`);
}

/**
* Get Screening Configuration for travel rule compliance
*/
public async getTravelRuleScreeningConfiguration(): Promise<ScreeningPolicyConfiguration> {
return await this.apiClient.issueGetRequest(`/v1/screening/travel_rule/policy_configuration`);
}

/**
* Update Bypass Screening Configuration for travel rule compliance
* @param screeningPolicyConfiguration
*/
public async updateTravelRulePolicyConfiguration(screeningPolicyConfiguration: ScreeningPolicyConfiguration): Promise<ScreeningPolicyConfiguration> {
return await this.apiClient.issuePutRequest(`/v1/screening/travel_rule/policy_configuration`, screeningPolicyConfiguration);
}

/**
* Creates Smart Transfers ticket
* @param data
Expand Down
75 changes: 75 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,81 @@ export interface TravelRuleVaspFilter {
order?: string;
}

export interface ScreeningPolicyConfiguration {
bypassScreeningDuringServiceOutages?: boolean;
inboundTransactionDelay?: number;
outboundTransactionDelay?: number;
}

export enum TravelRuleAction {
screen = "SCREEN",
pass = "PASS",
freeze = "FREEZE"
}

export interface TravelRulePolicyRule {
sourceType?: string;
sourceSubType?: string;
destType?: string;
destSubType?: string;
destAddress?: string;
sourceId?: string;
destId?: string;
asset?: string;
baseAsset?: string;
amount?: number;
amountUSD?: number;
networkProtocol?: string;
operation?: string;
action: TravelRuleAction;
}

export enum PolicyApprovalStatus {
live = "live",
processing = "processing"
}

export enum TransactionDirection {
inbound = "INBOUND",
outbound = "OUTBOUND"
}

export enum FbTravelRuleTransactionStatus {
completed = "COMPLETED",
pending = "PENDING",
rejected = "REJECTED",
failed = "FAILED",
canceled = "CANCELED",
blockingTimeExpired = "BLOCKING_TIME_EXPIRED",
}

export enum TravelRuleVerdict {
accept = "ACCEPT",
reject = "REJECT",
alert = "ALERT",
wait = "WAIT",
freeze = "FREEZE",
cancel = "CANCEL"
}

export interface TravelRuleRulesConfiguration {
direction?: TransactionDirection;
status?: FbTravelRuleTransactionStatus;
amountUSD?: number;
amount?: number;
asset?: string;
action: TravelRuleVerdict;
}

export interface TravelRulePolicy {
tenantId?: string;
policy: TravelRulePolicyRule[];
policyStatus?: PolicyApprovalStatus;
isDefault: boolean;
createDate?: Date;
lastUpdate: Date;
}

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

0 comments on commit ea9c931

Please sign in to comment.