Lucinity.Sdk
0.0.11
dotnet add package Lucinity.Sdk --version 0.0.11
NuGet\Install-Package Lucinity.Sdk -Version 0.0.11
<PackageReference Include="Lucinity.Sdk" Version="0.0.11" />
<PackageVersion Include="Lucinity.Sdk" Version="0.0.11" />
<PackageReference Include="Lucinity.Sdk" />
paket add Lucinity.Sdk --version 0.0.11
#r "nuget: Lucinity.Sdk, 0.0.11"
#:package Lucinity.Sdk@0.0.11
#addin nuget:?package=Lucinity.Sdk&version=0.0.11
#tool nuget:?package=Lucinity.Sdk&version=0.0.11
Lucinity.Sdk
The official Lucinity .NET library.
The Lucinity SDK provides a structured interface to interact with the Lucinity API, handling authentication, request execution, and response parsing to simplify development.
Installation
Using the .NET Core command-line interface (CLI) tools:
dotnet add package Lucinity.Sdk
Using the NuGet Command Line Interface (CLI):
nuget install Lucinity.Sdk
Documentation
For documentation see API docs
Configuration
Add authentication details received from customer support to appsettings.json:
{
"AuthServiceOptions": {
"ClientId": "{{ your-client_id }}",
"ClientSecret": "{{ your-client_secret }}",
"TokenUrl": "https://{{ your-lucinity-url }}/auth/realms/{{ your-lucinity-name }}/protocol/openid-connect/token"
},
"SdkOptions": {
"ApiKey": "{{ your-api_key }}",
"ApiUrl": "https://{{ your-lucinity-url }}/api"
}
}
Usage
Register and configure the Lucinity SDK in a .NET application:
using var host = Host.CreateDefaultBuilder()
.ConfigureAppConfiguration(config => config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true))
.ConfigureServices((context, services) => services.AddLucinitySDK(context.Configuration))
.Build();
using var scope = host.Services.CreateScope();
var provider = scope.ServiceProvider;
var bulkIngestion = provider.GetRequiredService<IBulkIngestionApi>();
Bulk Ingestion
An example of how to use the bulk ingestion.
var api = provider.GetRequiredService<IBulkIngestionApi>();
List<Actor> actors =
[
new Actor(
new Individual(
id: "actor-id-1",
name: "Test McTestson",
type: ActorType.INDIVIDUAL,
addresses:
[
new PostalAddress(type: PostalAddressType.HOME, street: ["Borgartun 25"], city: "Reykjavik",
country: "ISL", postalCode: "105")
],
asOfDate: DateOnly.FromDateTime(DateTime.UtcNow),
emails: [new EmailAddress("test@test.com", EmailAddressType.HOME)],
status: ActorStatus.ACTIVE,
dateOfBirth: DateOnly.FromDateTime(new DateTime(1980, 4, 7)),
nationality: "ISL",
gender: Gender.MALE,
phones:
[
new Phone(
number: "1234567",
type: PhoneNumberType.HOME,
customData: new Dictionary<string, CustomDataValue>()
{ { "verified", new CustomDataValue(false) } })
]
)
),
new Actor(
new LegalEntity(
id: "actor-id-2",
name: "SomeCompany",
type: ActorType.LEGALENTITY,
addresses:
[
new PostalAddress(type: PostalAddressType.HOME, street: ["Borgartun 25"], city: "Reykjavik",
country: "ISL", postalCode: "105")
],
asOfDate: DateOnly.FromDateTime(DateTime.UtcNow),
contactPerson: new ContactPerson(
name: "John Johnson",
phones:
[
new Phone(
number: "1234567",
type: PhoneNumberType.WORK
)
]
),
emails: [new EmailAddress("test@test.com", EmailAddressType.HOME)],
status: ActorStatus.ACTIVE,
phones:
[
new Phone(
number: "1234567",
type: PhoneNumberType.HOME,
customData: new Dictionary<string, CustomDataValue>()
{ { "verified", new CustomDataValue(true) } })
]
)
)
];
List<Transaction> transactions =
[
new Transaction(
id: Guid.NewGuid().ToString(),
amount: new Amount("USD", 100),
accountId: "account-1",
method: Method.CARD,
accountOwnerId: actors[0].AsIndividual().Id,
createdAt: DateTime.UtcNow,
counterparty: new TransactionCounterparty(
new CounterpartyIndividual(name: "Alexander Brown",
type: "INDIVIDUAL",
id: "1a26dbc0-fee7-47cf-8496-f294e4d5c7bf",
industry: new Industry(IndustryType.SIC, "6511"),
accountInfo: new BaseAccountInfo(
bankName: "Lewis-Williams",
bic: "yKSPBpZwXXYsS",
bankCode: "646-241",
accountNumber: "FTPT91539325507314",
iban: "GB18XPBC28042307071007",
country: "MLT"),
dateOfBirth: DateOnly.FromDateTime(new DateTime(1966, 1, 1)),
postalAddresses:
[
new PostalAddress(
street: ["123 Main Street"],
city: "Hinesville",
country: "DJI",
postalCode: "72489",
state: "California",
type: PostalAddressType.HEADQUARTERS
)
]
)
),
direction: Direction.INBOUND,
status: TransactionStatus.COMPLETED,
standardizedAmount: 100,
channel: Channel.POS,
purpose: Purpose.FEE
),
];
List<Observation> observations =
[
new Observation(
new AmlV2Observation(
createdAt: DateTime.Now,
id: new Guid(),
transactionIds: [..transactions.Select(model => model.Id)],
type: ObservationType.AMLV2
)
)
];
var caseId = Guid.NewGuid();
List<Case> cases =
[
new Case(
new AnalysisCase(
id: caseId,
type: CaseType.ANALYSIS,
actors:
[
new CaseActor(
id: "actor-id-1",
type: CaseActorType.FOCAL
)
],
observationIds:
[..observations.Select(observation => observation.AsAmlV2Observation().Id.ToString())]
)
),
new Case(
new FilingCase(
id: new Guid(),
type: CaseType.FILING,
analysisCaseId: caseId.ToString(),
jurisdiction: Jurisdiction.ISL,
actors:
[
new CaseActor(
id: "actor-id-2",
type: CaseActorType.FOCAL,
customData: new Dictionary<string, CustomDataValue>()
{ { "strength", new CustomDataValue("10") } })
],
observationIds:
[..observations.Select(observation => observation.AsAmlV2Observation().Id.ToString())]
))
];
var ingestionBulkPostRequest = new BulkIngestRequest()
{
Actors = actors,
Transactions = transactions,
Observations = observations,
Cases = cases
};
api.BulkIngest(ingestionBulkPostRequest);
Get Case
An example of how to use the get case API.
var api = provider.GetRequiredService<ICaseApi>();
var caseResponse = api.GetCase("61fc143a-71ad-45ec-a6d3-d5bf732ca78c");
Webhooks
An example of how to use WebHooks API
var api = provider.GetRequiredService<IWebhookApi>();
var createWebhookResponse = api.CreateWebhook(
new WebhookRequest(
"case-created-webhook",
"https://example.com",
["case.created"]
)
);
var response = api.GetWebhook(createWebhookResponse.Id);
var webhookId = new Guid(response.Id);
api.TestWebhook(webhookId);
api.UpdateWebhook(webhookId, new WebhookUpdateRequest(status: WebhookStatus.INACTIVE));
api.DeleteWebhook(webhookId);
Custom Data Schema Mapping
An example of how to register a custom data schema.
var api = provider.GetRequiredService<ISchemaMappingApi>();
api.CustomDataSchemaMappingAdd("actor", "my_custom_property", new CustomDataSchemaMappingRequest(
new Dictionary<string, object>()
{
{ "type", "object" },
{
"properties", new Dictionary<string, object>()
{
{
"nested_property", new Dictionary<string, string>()
{
{ "type", "string" }
}
},
{
"nested_array_property", new Dictionary<string, object>()
{
{ "type", "array" },
{
"items", new Dictionary<string, string>()
{
{
"type", "string"
}
}
}
}
}
}
},
{ "required", new string[] {"nested_property", "nested_array_property"} }
}
));
var actorCustomProperties = api.CustomDataSchemaMappingGetEntity("actor");
var actorCustomPropertySchema = api.CustomDataSchemaMappingGet("actor", "my_custom_property");
api.CustomDataSchemaMappingDelete("actor", "my_custom_property");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- JsonSubTypes (>= 2.0.1)
- Microsoft.Extensions.DependencyInjection (>= 9.0.2)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.2)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.1.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Minor update