Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Add this line to your application's Gemfile:
gem 'my_target_api', '~> 2.0.9'
Or install from command line:
$ gem install my_target_api
# You need an access token to use API
my_target_api = MyTargetApi.new(access_token)
# Root resources
campaigns_resource = my_target_api.resource('campaigns')
remarketing_resource = my_target_api.resource('remarketing', v: 2)
# Nested resources
remarketing_counters_resource = my_target_api.resource('remarketing/counters', v: 2)
remarketing_counters_resource = remarketing_resource.resource('counters')
Name | Default value | Description |
---|---|---|
:v | 1 | API version |
:logger | An object to log requests and exceptions. The object must respond to << method | |
:headers | Headers hash to pass with request |
remarketing_counters_resource.create(counter_id: 121212) # => [{ 'id' => 343434 }]
campaigns_resource.read # => [{ 'id' => 12345, ... }, { ... }]
campaigns_resource.read(id: 12345) # => [{ 'id' => 12345, ... }]
campaigns_resource.update(id: 12345, status: 'blocked') # => [{ 'id' => 12345, 'status' => 'blocked' }]
remarketing_counters_resource.delete(id: 343434) # => [{ 'success' => true }]
Name | Default value | Description |
---|---|---|
:id | Resource ID. Optional for Read, required for Update and Delete | |
:id_param_key | :id | Option key for resource ID |
campaigns_resource.read(id_key_param: :campaign_id, campaign_id: 12345) # => [{ 'id' => 12345, ... }]
static_resource = my_target_api.resource('content/static', v: 2)
picture = File.new('path/to/picture.jpg', 'rb')
static_resource.create(file: picture, data: { width: 1200, height: 800 })
search_phrases_resource = my_target_api.resource('search_phrases', v: 2)
phrases = "phrase\nfirst phrase\nsecond phrase\n"
search_phrases_resource.upload(phrases, name: 'search phrases list')
def read_active_campaigns
campaigns_resource.read(status: 'active')
rescue MyTargetApi::RequestError => e
puts e.message, e.method, e.url, e.params, e.request_body, e.response, e.backtrace
# You can access the original exception
puts e.original_exception&.message, e.original_exception&.backtrace
end
Name | Description |
---|---|
MyTargetApi::RequestError | Request didn't succeed |
bundle exec rspec
Create a pull-request or make an issue
FAQs
Unknown package
We found that my_target_api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.