Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
com.github.javadev:passninja
Advanced tools
Include the following in your pom.xml
for Maven:
<dependencies>
<dependency>
<groupId>com.github.javadev</groupId>
<artifactId>passninja</artifactId>
<version>1.4</version>
</dependency>
...
</dependencies>
Gradle:
compile 'com.github.javadev:passninja:1.4'
PassNinjaClient
Use this class to init a Passninja
object. Make sure to
pass your user credentials to make any authenticated requests.
import com.passninja.Passninja;
String accountId = "**your-account-id**";
String apiKey = "**your-api-key**";
Passninja.init(accountId, apiKey);
We've placed our demo user API credentials in this example. Replace it with your actual API credentials to test this code through your PassNinja account and don't hesitate to contact PassNinja with our built in chat system if you'd like to subscribe and create your own custom pass type(s).
For more information on how to use passninja-java
once it loads, please refer to
the PassNinja JS API reference
PassNinjaClientMethods
This library currently supports methods for creating, getting, updating, and deleting passes via the PassNinja api. The methods are outlined below.
Map<String, Object> pass = new HashMap<>();
pass.put("discount", "50%");
pass.put("memberName", "John");
PassninjaResponse<Pass> response = Pass.create("demo.coupon", /* passType */
pass /* passData */);
System.out.println(response.getResponseBody().getUrls());
System.out.println(response.getResponseBody().getPassType());
System.out.println(response.getResponseBody().getSerialNumber());
PassninjaResponse<Pass> response = Pass.get("demo.coupon", /* passType */
"97694bd7-3493-4b39-b805-20e3e5e4c770" /* serialNumber */);
Map<String, Object> pass = new HashMap<>();
pass.put("discount", "100%");
pass.put("memberName", "Ted");
PassninjaResponse<Pass> response = Pass.put("demo.coupon", /* passType */
"97694bd7-3493-4b39-b805-20e3e5e4c770", /* serialNumber */
pass /* passData */);
PassninjaResponse<Pass> response = Pass.delete("demo.coupon", /* passType */
"97694bd7-3493-4b39-b805-20e3e5e4c770" /* serialNumber */);
System.out.println("Pass deleted. Serial_number: ", response.getResponseBody().getSerialNumber());
PassninjaResponse<Pass> response = Pass.deleteForce("demo.coupon", /* passType */
"97694bd7-3493-4b39-b805-20e3e5e4c770" /* serialNumber */);
System.out.println("Pass deleted. Serial_number: ", response.getResponseBody().getSerialNumber());
PassninjaResponse<PassTemplate> response = PassTemplate.find("ptk_0x2" /* passTemplateId */);
System.out.println("PassTemplate name: ", response.getResponseBody().getName());
FAQs
Unknown package
We found that com.github.javadev:passninja demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.