Class: Chainalysis::V2Client

Inherits:
BaseClient show all
Defined in:
lib/chainalysis/client.rb

Overview

Client for V2 API endpoints

Constant Summary

Constants inherited from BaseClient

BaseClient::ADMIN_URL, BaseClient::BASE_URL, BaseClient::VERSION

Instance Attribute Summary

Attributes inherited from BaseClient

#adapter, #api_key

Instance Method Summary collapse

Methods inherited from BaseClient

#initialize

Constructor Details

This class inherits a constructor from Chainalysis::BaseClient

Instance Method Details

#get_categoriesObject



260
261
262
# File 'lib/chainalysis/client.rb', line 260

def get_categories
  get_request('v2/categories')
end

#get_internal_usersObject



264
265
266
# File 'lib/chainalysis/client.rb', line 264

def get_internal_users
  get_request('organization/users', admin: true)
end

#get_transfer(external_id:, format_type: nil) ⇒ Object



222
223
224
225
# File 'lib/chainalysis/client.rb', line 222

def get_transfer(external_id:, format_type: nil)
  params = { format_type: format_type } if format_type
  get_request("v2/transfers/#{external_id}", params)
end

#get_transfer_alerts(external_id:) ⇒ Object



231
232
233
# File 'lib/chainalysis/client.rb', line 231

def get_transfer_alerts(external_id:)
  get_request("v2/transfers/#{external_id}/alerts")
end

#get_transfer_exposures(external_id:) ⇒ Object



227
228
229
# File 'lib/chainalysis/client.rb', line 227

def get_transfer_exposures(external_id:)
  get_request("v2/transfers/#{external_id}/exposures")
end

#get_transfer_network_identifications(external_id:) ⇒ Object



235
236
237
# File 'lib/chainalysis/client.rb', line 235

def get_transfer_network_identifications(external_id:)
  get_request("v2/transfers/#{external_id}/network-identifications")
end

#get_withdrawal_attempt(external_id:, format_type: nil) ⇒ Object



239
240
241
242
# File 'lib/chainalysis/client.rb', line 239

def get_withdrawal_attempt(external_id:, format_type: nil)
  params = { format_type: format_type } if format_type
  get_request("v2/withdrawal-attempts/#{external_id}", params)
end

#get_withdrawal_attempt_alerts(external_id:) ⇒ Object



248
249
250
# File 'lib/chainalysis/client.rb', line 248

def get_withdrawal_attempt_alerts(external_id:)
  get_request("v2/withdrawal-attempts/#{external_id}/alerts")
end

#get_withdrawal_attempt_exposures(external_id:) ⇒ Object



244
245
246
# File 'lib/chainalysis/client.rb', line 244

def get_withdrawal_attempt_exposures(external_id:)
  get_request("v2/withdrawal-attempts/#{external_id}/exposures")
end

#get_withdrawal_attempt_high_risk_addresses(external_id:) ⇒ Object



252
253
254
# File 'lib/chainalysis/client.rb', line 252

def get_withdrawal_attempt_high_risk_addresses(external_id:)
  get_request("v2/withdrawal-attempts/#{external_id}/high-risk-addresses")
end

#get_withdrawal_attempt_network_identifications(external_id:) ⇒ Object



256
257
258
# File 'lib/chainalysis/client.rb', line 256

def get_withdrawal_attempt_network_identifications(external_id:)
  get_request("v2/withdrawal-attempts/#{external_id}/network-identifications")
end

#register_transfer(user_id:, network:, asset:, transfer_reference:, direction:, **options) ⇒ Object



193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/chainalysis/client.rb', line 193

def register_transfer(user_id:, network:, asset:, transfer_reference:, direction:, **options)
  post_request(
    "v2/users/#{user_id}/transfers",
    {
      network: network,
      asset: asset,
      transferReference: transfer_reference,
      direction: direction,
      **options
    }
  )
end

#register_withdrawal_attempt(user_id:, network:, asset:, address:, attempt_identifier:, asset_amount:, attempt_timestamp:, **options) ⇒ Object



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/chainalysis/client.rb', line 206

def register_withdrawal_attempt(user_id:, network:, asset:, address:, attempt_identifier:,
                                asset_amount:, attempt_timestamp:, **options)
  post_request(
    "v2/users/#{user_id}/withdrawal-attempts",
    {
      network: network,
      asset: asset,
      address: address,
      attemptIdentifier: attempt_identifier,
      assetAmount: asset_amount,
      attemptTimestamp: attempt_timestamp,
      **options
    }
  )
end