
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
@chainvine/sdk
Advanced tools
A light client for interacting with the ChainVine API (note: you will need an active subscription for ChainVine in order to utilise the SDK).
npm install @chainvine/sdk
There are two methods of interacting with the ChainVine API, either by providing a Chainvine API Key (available under 'Community Settings' from your admin dashboard) or by omitting the API key and ensuring all requests are sent from a previously whitelisted domains (these can also be managed under 'Community Settings' from your admin dashboard).
It is advised to use the API key method as it is more secure and allows you to use the SDK from any domain, but only if you are operating from a server context (i.e. from an API) as you do not want to expose your API key in a browser.
Should you be using the ChainVine SDK on the browser side you will need to follow the domain whitelisting approach.
Please consult the documentation for usage and integration details: https://docs.chainvine.xyz/developers/sdk
import { ChainvineClient } from '@chainvine/sdk/lib';
// Initialise the client (without an API key or any overriden settings)
const client = new ChainvineClient();
//OR, Initialise the client with an API key and/or supply some config
const client = new ChainvineClient({
apiKey: '<YOUR API KEY>', //optional, if not provided you will need to whitelist your domain from your admin dashboard
testMode: true, // optional, defaults to false. When set to true, the SDK will use the test API endpoint
logToConsole: true, // optional, defaults to false. When set to true, the SDK will log errors and requests/responses to the console (useful for development and debugging)
});
// All user-specific actions require a userClient
const user_wallet = '0x1234567890';
const userClient = await client.syncUser(user_wallet)
We offer some helper functions to make integration with ChainVine easier.
Note: these helper functions rely on browser functionality and must be executed client-side.
This will create a CV_REF cookie for you (which will expire in 120 days by default) you can either interrogate requests to your API for this if you are using the SDK from your API or call getReferrerId() to fetch when you need it in your browser
import { storeReferrer } from '@chainvine/sdk';
storeReferrer(); //This will fetch the r query parameter from the current URL (if available) and store it in a CV_REF cookie
You may customise the cookie settings as follows:
storeReferrer({
durationDays: 30, //Override the default cookie duration (120 days)
ref: 'ABC123', //Should you already have access to the referrer code, and if you do not want it fetched from the URL, you can provide it directly
});
import { getReferrer } from '@chainvine/sdk';
//Fetches a previously stored referrer code from the CV_REF cookie if available, returns undefined if not
getReferrer();
import { clearReferrer } from '@chainvine/sdk';
//Clear the CV_REF cookie:
clearReferrer();
import { ChainvineClient } from '@chainvine/sdk/lib';
import { getReferrer, storeReferrer } from '@chainvine/sdk';
const client = new ChainvineClient();
...
//Fetch and store the referrer_id from the URL on page load:
storeReferrer();
...
//When a user connects their wallet (or at any point once you have access to their wallet address)
//Note: this could be a completely different page or flow to the one where the referrer was stored
const user = await client.syncUser('0x1234567890')
const referral = await user.referral({campaign}).linkReferrer(getReferrer());
FAQs
SDK for integrating with app.chainvine.xyz
The npm package @chainvine/sdk receives a total of 104 weekly downloads. As such, @chainvine/sdk popularity was classified as not popular.
We found that @chainvine/sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.