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

Travel Rule Configuration and Policy routes #187

Merged
merged 11 commits into from
Sep 19, 2023
Merged
32 changes: 32 additions & 0 deletions src/fireblocks-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ import {
SmartTransfersTicketsFilters,
SmartTransfersTicketTermPayload,
SmartTransfersTicketTermFundPayload,
ScreeningPolicyConfiguration,
TravelRulePolicy,
TravelRuleRulesConfiguration,
SmartTransfersTicketTermResponse,
SmartTransfersUserGroupsResponse,
UsersGroup,
Expand Down Expand Up @@ -1630,6 +1633,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