didit-sdk 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/README.md +0 -2
  4. data/lib/didit/resources/address_validation.rb +2 -2
  5. data/lib/didit/resources/analytics.rb +29 -0
  6. data/lib/didit/resources/bank.rb +15 -6
  7. data/lib/didit/resources/database_validation.rb +65 -0
  8. data/lib/didit/resources/email.rb +22 -2
  9. data/lib/didit/resources/id_verification.rb +14 -13
  10. data/lib/didit/resources/id_wallets.rb +84 -0
  11. data/lib/didit/resources/ip.rb +2 -2
  12. data/lib/didit/resources/kyb.rb +14 -7
  13. data/lib/didit/resources/phone.rb +28 -2
  14. data/lib/didit/resources/pricing.rb +4 -2
  15. data/lib/didit/resources/sessions.rb +463 -33
  16. data/lib/didit/resources/transactions.rb +7 -2
  17. data/lib/didit/resources/travel_rule.rb +96 -0
  18. data/lib/didit/resources/users.rb +25 -6
  19. data/lib/didit/resources/wallet_screening.rb +5 -6
  20. data/lib/didit/resources/webhooks.rb +8 -1
  21. data/lib/didit/types/aml.rb +19 -0
  22. data/lib/didit/types/components.rb +908 -28
  23. data/lib/didit/types/email.rb +28 -0
  24. data/lib/didit/types/kyb.rb +80 -5
  25. data/lib/didit/types/phone.rb +38 -0
  26. data/lib/didit/types/sessions.rb +476 -5
  27. data/lib/didit/types/travel_rule.rb +7 -0
  28. data/lib/didit/types/wallet_screening.rb +13 -6
  29. data/lib/didit/types.rb +121 -0
  30. data/lib/didit/version.rb +1 -1
  31. data/sig/didit/resources/analytics.rbs +1 -0
  32. data/sig/didit/resources/bank.rbs +1 -1
  33. data/sig/didit/resources/database_validation.rbs +1 -1
  34. data/sig/didit/resources/email.rbs +1 -1
  35. data/sig/didit/resources/id_wallets.rbs +2 -0
  36. data/sig/didit/resources/phone.rbs +1 -1
  37. data/sig/didit/resources/sessions.rbs +14 -5
  38. data/sig/didit/resources/transactions.rbs +1 -1
  39. data/sig/didit/resources/travel_rule.rbs +5 -0
  40. data/sig/didit/resources/users.rbs +1 -1
  41. data/sig/didit/resources/wallet_screening.rbs +1 -1
  42. data/sig/didit/resources/webhooks.rbs +1 -1
  43. data/sig/didit/types/aml.rbs +18 -0
  44. data/sig/didit/types/bank.rbs +1 -1
  45. data/sig/didit/types/components.rbs +780 -4
  46. data/sig/didit/types/database_validation.rbs +1 -1
  47. data/sig/didit/types/email.rbs +22 -1
  48. data/sig/didit/types/id_wallets.rbs +4 -0
  49. data/sig/didit/types/kyb.rbs +75 -5
  50. data/sig/didit/types/phone.rbs +29 -1
  51. data/sig/didit/types/sessions.rbs +462 -2
  52. data/sig/didit/types/travel_rule.rbs +9 -0
  53. data/sig/didit/types/users.rbs +1 -1
  54. data/sig/didit/types/wallet_screening.rbs +5 -1
  55. data/sig/didit/types/webhooks.rbs +1 -1
  56. metadata +1 -1
@@ -206,16 +206,21 @@ module Didit
206
206
  # @param travel_rule_status [String] Return only transactions whose Travel Rule transfer is in this exact status
207
207
  # (for example `ON_HOLD` or `AWAITING_COUNTERPARTY`). `count` follows this filter; `total_transactions` still
208
208
  # counts every transaction in the application.
209
+ # @param assignee [String] Comma-separated; a transaction matches when it meets any value. `unassigned` is what
210
+ # nobody holds yet, `rules` is what the rules decided on their own without a reviewer, and a member email
211
+ # matches the reviewer assigned to it. `me` is the signed-in Console reviewer, so an API key sending `me` gets
212
+ # `400`.
209
213
  # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
210
214
  # @return [Didit::Page<Didit::Types::TransactionsListResponseResults>]
211
- def list(limit: OMIT, offset: OMIT, travel_rule_status: OMIT, request_options: nil)
215
+ def list(limit: OMIT, offset: OMIT, travel_rule_status: OMIT, assignee: OMIT, request_options: nil)
212
216
  @client.request(
213
217
  :get,
214
218
  "/v3/transactions/",
215
219
  query: {
216
220
  "limit" => limit,
217
221
  "offset" => offset,
218
- "travel_rule_status" => travel_rule_status
222
+ "travel_rule_status" => travel_rule_status,
223
+ "assignee" => assignee
219
224
  },
220
225
  page: Types::TransactionsListResponseResults,
221
226
  request_options: request_options
@@ -20,6 +20,11 @@ module Didit
20
20
  @transfers ||= Transfers.new(@client)
21
21
  end
22
22
 
23
+ # @return [Didit::Resources::TravelRule::UnmatchedDeposits]
24
+ def unmatched_deposits
25
+ @unmatched_deposits ||= UnmatchedDeposits.new(@client)
26
+ end
27
+
23
28
  # @return [Didit::Resources::TravelRule::WalletAddresses]
24
29
  def wallet_addresses
25
30
  @wallet_addresses ||= WalletAddresses.new(@client)
@@ -843,6 +848,97 @@ module Didit
843
848
  end
844
849
  end
845
850
 
851
+ # The +travel_rule.unmatched_deposits+ resource.
852
+ class UnmatchedDeposits < Didit::Resource
853
+ # List unmatched Travel Rule deposits
854
+ #
855
+ # Inbound deposits that are still waiting for the originating VASP's Travel Rule data: their transfer is
856
+ # `AWAITING_COUNTERPARTY`, `NOT_ENOUGH_COUNTERPARTY_DATA` or `COUNTERPARTY_VASP_NOT_FOUND`, no received
857
+ # message is paired with them, and nobody matched them by hand. The rows and the filters are the same as in
858
+ # `GET /v3/travel-rule/transfers/`, newest first, paginated with `limit` (default 50) and `offset`. Pair a
859
+ # deposit with the message the originating VASP sent with `POST
860
+ # /v3/travel-rule/unmatched/{transaction_uuid}/match/`.
861
+ #
862
+ # +GET /v3/travel-rule/unmatched/+
863
+ #
864
+ # @param direction [String] INBOUND, OUTBOUND, or both comma-separated. Case-sensitive.
865
+ # @param status [String] One or more transfer statuses, comma-separated.
866
+ # @param rail [String] One or more of INTERNAL, TRP, GTR, TRUST, VERIFYVASP, SYGNA, EMAIL, TEST_VASP,
867
+ # comma-separated.
868
+ # @param kind [String] withdrawal, deposit or message, comma-separated.
869
+ # @param currency [String] The transaction's currency, case-insensitive.
870
+ # @param start_date [Date, String] Transfers created on or after this day (UTC), YYYY-MM-DD.
871
+ # @param end_date [Date, String] Transfers created on or before this day (UTC), YYYY-MM-DD.
872
+ # @param counterparty [String] The `id` of a directory entry or Didit network member from GET
873
+ # /v3/travel-rule/vasps/: your transfers with that counterparty. A value that is not a valid id answers 400.
874
+ # @param limit [Integer] Page size, default 50.
875
+ # @param offset [Integer] Rows to skip.
876
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
877
+ # @return [Didit::Page<Didit::Types::TravelRuleTransferRow>]
878
+ def list(
879
+ direction: OMIT,
880
+ status: OMIT,
881
+ rail: OMIT,
882
+ kind: OMIT,
883
+ currency: OMIT,
884
+ start_date: OMIT,
885
+ end_date: OMIT,
886
+ counterparty: OMIT,
887
+ limit: OMIT,
888
+ offset: OMIT,
889
+ request_options: nil
890
+ )
891
+ @client.request(
892
+ :get,
893
+ "/v3/travel-rule/unmatched/",
894
+ query: {
895
+ "direction" => direction,
896
+ "status" => status,
897
+ "rail" => rail,
898
+ "kind" => kind,
899
+ "currency" => currency,
900
+ "start_date" => start_date,
901
+ "end_date" => end_date,
902
+ "counterparty" => counterparty,
903
+ "limit" => limit,
904
+ "offset" => offset
905
+ },
906
+ page: Types::TravelRuleTransferRow,
907
+ request_options: request_options
908
+ )
909
+ end
910
+
911
+ # Match a Travel Rule deposit to a received message
912
+ #
913
+ # Pair an inbound deposit that is still waiting for originator data with the Travel Rule message the
914
+ # originating VASP sent for it. The deposit takes the message's originator data, counterparty VASP and rail,
915
+ # and both transfers record the match on their timelines. `transaction_uuid` is the deposit's `transaction_id`
916
+ # from `GET /v3/travel-rule/unmatched/`. `transaction_id` in the body is the received message's
917
+ # `transaction_id`, from a row of `GET /v3/travel-rule/transfers/?kind=message`; the transfer's own `id` is
918
+ # not found. The message must be for the same asset as the deposit. A deposit or message deleted from the
919
+ # Console answers `404`; one that has already moved on (matched, or no longer waiting) answers `409`.
920
+ #
921
+ # +POST /v3/travel-rule/unmatched/{transaction_uuid}/match/+
922
+ #
923
+ # @param transaction_uuid [String] The `transaction_id` of the unmatched deposit.
924
+ # @param transaction_id [String] The `transaction_id` of the received Travel Rule message (a row with `kind:
925
+ # message`).
926
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
927
+ # @return [Didit::Types::TravelRuleManualMatchResponse]
928
+ def match(transaction_uuid, transaction_id:, request_options: nil)
929
+ @client.request(
930
+ :post,
931
+ "/v3/travel-rule/unmatched/{transaction_uuid}/match/",
932
+ path_params: { "transaction_uuid" => transaction_uuid },
933
+ body: {
934
+ "transaction_id" => transaction_id
935
+ },
936
+ response: Types::TravelRuleManualMatchResponse,
937
+ request_options: request_options
938
+ )
939
+ end
940
+ end
941
+
846
942
  # The +travel_rule.wallet_addresses+ resource.
847
943
  class WalletAddresses < Didit::Resource
848
944
  # Import wallet addresses in bulk
@@ -15,10 +15,13 @@ module Didit
15
15
  # `filter_has_approved_sessions` and `filter_has_declined_sessions` are not refused and not applied, so with
16
16
  # `delete_all: true` they still delete every user; do not send them.
17
17
  #
18
- # **Biometric templates:** every image-free biometric template retained for these users after session deletion
19
- # (see `/v3/biometric-templates/`) is purged before the user is deleted, so the person stops matching in
20
- # duplicate detection and Face Search. If a template cannot be purged because a biometric store is unavailable,
21
- # the call returns `503`, no user in the request is deleted, and repeating the request finishes the job.
18
+ # **Biometric templates:** unless you set `retain_face_embeddings` to `true`, every image-free biometric
19
+ # template retained for these users after session deletion (see `/v3/biometric-templates/`) is purged before the
20
+ # user is deleted, so the person stops matching in duplicate detection and Face Search. With
21
+ # `retain_face_embeddings: true` and `face_retention_days`, you choose to keep one image-free biometric template
22
+ # per person for that many days, and nothing else about the person is kept. If a template cannot be purged
23
+ # because a biometric store is unavailable, the call returns `503`, no user in the request is deleted, and
24
+ # repeating the request finishes the job.
22
25
  #
23
26
  # **Filed regulatory reports:** if the selected data is in a finalized regulatory report, the whole request is
24
27
  # refused with `409` and nothing is deleted. The body uses `code: in_filed_report` and names each report with
@@ -30,16 +33,32 @@ module Didit
30
33
  # @param didit_internal_id_list [Array<String>] Didit internal user IDs to delete - the `didit_internal_id`
31
34
  # returned by the create and get endpoints.
32
35
  # @param delete_all [Boolean] If `true`, deletes every user in the application.
36
+ # @param retain_face_embeddings [Boolean] Your explicit choice to keep one image-free biometric template of each
37
+ # deleted person for duplicate detection, for `face_retention_days`. Everything else about the person is
38
+ # deleted. Omit it, or send `false`, to delete the templates with the users. When `true`, `face_retention_days`
39
+ # is required.
40
+ # @param face_retention_days [Integer] Number of days the image-free biometric template is kept when
41
+ # `retain_face_embeddings` is `true`. Required with it, and rejected without it with a `400` on
42
+ # `face_retention_days`.
33
43
  # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
34
44
  # @return [Didit::Types::UsersBatchDeleteResponse]
35
- def batch_delete(vendor_data_list: OMIT, didit_internal_id_list: OMIT, delete_all: OMIT, request_options: nil)
45
+ def batch_delete(
46
+ vendor_data_list: OMIT,
47
+ didit_internal_id_list: OMIT,
48
+ delete_all: OMIT,
49
+ retain_face_embeddings: OMIT,
50
+ face_retention_days: OMIT,
51
+ request_options: nil
52
+ )
36
53
  @client.request(
37
54
  :post,
38
55
  "/v3/users/delete/",
39
56
  body: {
40
57
  "vendor_data_list" => vendor_data_list,
41
58
  "didit_internal_id_list" => didit_internal_id_list,
42
- "delete_all" => delete_all
59
+ "delete_all" => delete_all,
60
+ "retain_face_embeddings" => retain_face_embeddings,
61
+ "face_retention_days" => face_retention_days
43
62
  },
44
63
  response: Types::UsersBatchDeleteResponse,
45
64
  request_options: request_options
@@ -17,18 +17,17 @@ module Didit
17
17
  #
18
18
  # @param wallet_address [String] The crypto address or network identifier to screen. Must match the selected
19
19
  # network (e.g. a `0x`-prefixed 40-hex-char address for EVM chains). Alias: `address`.
20
- # @param blockchain [String] Network identifier. Managed screening supports BTC, ETH, LTC, XRP, BCH, DOGE, TRX,
21
- # SOL, MATIC, BNB, BASE (Base), OP (Optimism), and ARB (Arbitrum One). USDT and USDC are legacy Ethereum
22
- # aliases, not multi-network searches. Connected-provider coverage varies. LIGHTNING requires a supported
23
- # connected provider. CELO (Celo), MODE (Mode) and PLUME (Plume) are screened through a connected TRM Labs
24
- # acco...
20
+ # @param blockchain [String] Optional network identifier. When omitted, the network is read from the address
21
+ # format: `bc1`, `1` and `3` addresses are Bitcoin (BTC), `T` addresses are Tron (TRX) and base58 public keys
22
+ # are Solana (SOL). A `0x` address is valid on every EVM network, so omitting `blockchain` for it answers 422
23
+ # with the candidate networks in `candidate_chains`. Managed screening supports BTC, ETH, LTC, XRP, BCH,...
25
24
  # @param direction [String] Optional. Whether the address is being screened as an inbound (deposit) or outbound
26
25
  # (withdrawal) counterparty. Accepts `inbound`, `outbound`, `deposit`, or `withdrawal`. Defaults to a neutral
27
26
  # pre-transfer screen when omitted. This is passed to the provider as context only; it does not change the
28
27
  # returned `risk_score`, `severity`, or the `source_of_funds`/`destination_of_funds` breakdowns, which a...
29
28
  # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
30
29
  # @return [Didit::Types::WalletScreeningResult]
31
- def screen(wallet_address:, blockchain:, direction: OMIT, request_options: nil)
30
+ def screen(wallet_address:, blockchain: OMIT, direction: OMIT, request_options: nil)
32
31
  @client.request(
33
32
  :post,
34
33
  "/v3/wallet-screening/",
@@ -73,6 +73,11 @@ module Didit
73
73
  # @param allowed_return_hosts [Array<String>] Replaces the whole list of Digital ID wallet return hosts. Bare
74
74
  # hostnames only, such as `shop.example.com`: no scheme, port, path or wildcard. Values are lowercased and
75
75
  # duplicates are dropped. Send `[]` to clear the list.
76
+ # @param allowed_domains [Array<String>] Replaces the whole list of allowed origins. Origins (for example
77
+ # `https://app.example.com`; `http` only for `localhost`) the hosted verification flow may be embedded in and
78
+ # may send the user back to with a session callback. Server-to-server calls are not affected. An empty list
79
+ # means no restriction. Didit stores each origin in lower case without a default port. An invalid entry fails
80
+ # with `400` o...
76
81
  # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
77
82
  # @return [Didit::Types::WebhookConfig]
78
83
  def update_config(
@@ -85,6 +90,7 @@ module Didit
85
90
  face_retention_days: OMIT,
86
91
  biometric_consent_mode: OMIT,
87
92
  allowed_return_hosts: OMIT,
93
+ allowed_domains: OMIT,
88
94
  request_options: nil
89
95
  )
90
96
  @client.request(
@@ -99,7 +105,8 @@ module Didit
99
105
  "face_retention_policy" => face_retention_policy,
100
106
  "face_retention_days" => face_retention_days,
101
107
  "biometric_consent_mode" => biometric_consent_mode,
102
- "allowed_return_hosts" => allowed_return_hosts
108
+ "allowed_return_hosts" => allowed_return_hosts,
109
+ "allowed_domains" => allowed_domains
103
110
  },
104
111
  response: Types::WebhookConfig,
105
112
  request_options: request_options
@@ -29,6 +29,25 @@ module Didit
29
29
  VALUES = [PERSON, COMPANY].freeze
30
30
  end
31
31
 
32
+ # Known values of an open enum: the API may send others.
33
+ module AmlScreenResponseAmlHitsDatasets
34
+ PEP = "PEP"
35
+ PEP_LEVEL_1 = "PEP Level 1"
36
+ PEP_LEVEL_2 = "PEP Level 2"
37
+ PEP_LEVEL_3 = "PEP Level 3"
38
+ PEP_LEVEL_4 = "PEP Level 4"
39
+ SANCTIONS = "Sanctions"
40
+ ADVERSE_MEDIA = "Adverse Media"
41
+ WARNINGS_AND_REGULATORY_ENFORCEMENT = "Warnings and Regulatory Enforcement"
42
+ FITNESS_AND_PROBITY = "Fitness and Probity"
43
+ SIP = "SIP"
44
+ SIE = "SIE"
45
+ INSOLVENCY = "Insolvency"
46
+ OTHER_LISTS = "Other Lists"
47
+
48
+ VALUES = [PEP, PEP_LEVEL_1, PEP_LEVEL_2, PEP_LEVEL_3, PEP_LEVEL_4, SANCTIONS, ADVERSE_MEDIA, WARNINGS_AND_REGULATORY_ENFORCEMENT, FITNESS_AND_PROBITY, SIP, SIE, INSOLVENCY, OTHER_LISTS].freeze
49
+ end
50
+
32
51
  # `False Positive` - `match_score` below `aml_match_score_threshold`, excluded from risk assessment. `Unreviewed`
33
52
  # - possible match awaiting review. `Confirmed Match` / `Inconclusive` - set manually by a reviewer (via the
34
53
  # Business Console) on saved sessions; that review capability is not part of this spec.