From 6597f55c4c660ccbf0628c1422327851fd19474a Mon Sep 17 00:00:00 2001 From: rade-fireblocks <129152277+rade-fireblocks@users.noreply.github.com> Date: Tue, 6 Jun 2023 08:15:24 +0200 Subject: [PATCH] Improve Travel Rule interface with additional fields update existing one (#176) * Improve Travel Rule interface with addtional fields update existinog one * Remove asset name and amount from travel rule message interface --- src/types.ts | 65 +++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/src/types.ts b/src/types.ts index 29070743..331f56e0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -296,57 +296,46 @@ export interface ValidateCreateTravelRuleTransaction { skipBeneficiaryDataValidation?: boolean; } - export interface TravelRule { + originatorRef?: string; + beneficiaryRef?: string; originatorVASPdid: string; + travelRuleBehavior?: boolean; beneficiaryVASPdid: string; - originator?: TROriginator; - beneficiary?: TROriginator; + beneficiaryVASPname?: string; + originator: TROriginator; + beneficiary: TRBeneficiary; pii?: PII; jsonDidKey?: string; } - -interface PII { - originator?: TROriginator; - beneficiary?: TROriginator; -} - -interface TROriginator { +export interface TROriginator { originatorPersons?: TROriginatorPerson[]; - beneficiaryPersons?: TROriginatorPerson[]; accountNumber?: string[]; } -interface TROriginatorPersons extends Array {} - -interface TROriginatorPerson { +export interface TROriginatorPerson { naturalPerson?: TRNaturalPerson; legalPerson?: TRNaturalPerson; } -interface TRNaturalPerson { - name?: TRName; - geographicAddress?: TRGeographicAddress; +export interface TRNaturalPerson { + name: TRName[]; + geographicAddress?: TRGeographicAddress[]; nationalIdentification?: TRNationalIdentification; dateAndPlaceOfBirth?: TRDateAndPlaceOfBirth; } -interface TRName extends Array {} - -interface TRPersonNameIdentifier { - nameIdentifier?: TRNameIdentifier; +export interface TRName { + nameIdentifier?: TRNameIdentifier[]; } -interface TRNameIdentifier { +export interface TRNameIdentifier { primaryIdentifier?: string; secondaryIdentifier?: string; - nameIdentifierType?: string; } -interface TRGeographicAddress extends Array {} - -interface TRGeographicAddressData { +export interface TRGeographicAddress { streetName?: string; townName?: string; country?: string; @@ -365,27 +354,41 @@ interface TRGeographicAddressData { addressLine?: string; } -interface TRNationalIdentification { - countryOfIssue?: string; +export interface TRNationalIdentification { nationalIdentifier?: string; nationalIdentifierType?: string; + registrationAuthority?: string; + countryOfIssue?: string; } -interface TRDateAndPlaceOfBirth { +export interface TRDateAndPlaceOfBirth { dateOfBirth?: string; placeOfBirth?: string; } +export interface TRBeneficiary { + beneficiaryPersons?: TRBeneficiaryPerson[]; + originatorPersons?: TROriginatorPerson[]; + accountNumber?: string[]; +} + +export interface TRBeneficiaryPerson { + naturalPerson?: TRNaturalPerson; +} + +interface PII { + originator?: TROriginator; + beneficiary?: TRBeneficiary; +} + export interface TravelRuleOptions { clientId: string; clientSecret: string; authURL?: string; audience?: string; audiencePII?: string; - baseURL?: string; baseURLPII?: string; - jsonDidKey?: string; beneficiaryDidKey?: string; travelRuleMessage?: TravelRule;