New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rosen-bridge/tokens

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rosen-bridge/tokens - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

4

dist/lib/index.d.ts

@@ -1,2 +0,2 @@

export { TokenMap } from "./TokenMap/TokenMap";
export { RosenTokens } from "./TokenMap/types";
export { TokenMap } from './TokenMap/TokenMap';
export { RosenTokens } from './TokenMap/types';

@@ -1,2 +0,2 @@

import { RosenTokens } from "./types";
import { RosenTokens } from './types';
/**

@@ -3,0 +3,0 @@ * TokenMap class searches for different assets properties in different chains

@@ -29,3 +29,4 @@ "use strict";

for (const [key, val] of Object.entries(condition)) {
if (!Object.hasOwnProperty.call(resToken, key) || resToken[key] !== val) {
if (!Object.hasOwnProperty.call(resToken, key) ||
resToken[key] !== val) {
return false;

@@ -32,0 +33,0 @@ }

@@ -11,31 +11,31 @@ "use strict";

const firstToken = {
"ergo": {
"tokenID": "1111111111111111111111111111111111111111111111111111111111111111",
"tokenName": "test token1"
ergo: {
tokenID: '1111111111111111111111111111111111111111111111111111111111111111',
tokenName: 'test token1',
},
"cardano": {
"fingerprint": "asset111111111111111111111111111111111111111",
"policyID": "22222222222222222222222222222222222222222222222222222222",
"assetID": "3333333333333333333333333333333333333333333333333333333333333333333333333333"
}
cardano: {
fingerprint: 'asset111111111111111111111111111111111111111',
policyID: '22222222222222222222222222222222222222222222222222222222',
assetID: '3333333333333333333333333333333333333333333333333333333333333333333333333333',
},
};
const secondToken = {
"ergo": {
"tokenID": "tokenId",
"tokenName": "test token3"
ergo: {
tokenID: 'tokenId',
tokenName: 'test token3',
},
"cardano": {
"fingerprint": "asset3fingerprint",
"policyID": "policyID3",
"assetID": "assetID3"
}
cardano: {
fingerprint: 'asset3fingerprint',
policyID: 'policyID3',
assetID: 'assetID3',
},
};
describe("TokenMap", () => {
describe("search", () => {
it("should return asset with condition on the policyID and assetID", () => {
describe('TokenMap', () => {
describe('search', () => {
it('should return asset with condition on the policyID and assetID', () => {
const map = firstSample_json_1.default;
const tokenMap = new lib_1.TokenMap(map);
const res = tokenMap.search("cardano", {
policyID: "22222222222222222222222222222222222222222222222222222222",
assetID: "3333333333333333333333333333333333333333333333333333333333333333333333333333"
const res = tokenMap.search('cardano', {
policyID: '22222222222222222222222222222222222222222222222222222222',
assetID: '3333333333333333333333333333333333333333333333333333333333333333333333333333',
});

@@ -45,7 +45,7 @@ (0, chai_1.expect)(res.length).to.be.eql(1);

});
it("returns asset with specific ergo tokenID", () => {
it('returns asset with specific ergo tokenID', () => {
const map = firstSample_json_1.default;
const tokenMap = new lib_1.TokenMap(map);
const res = tokenMap.search("ergo", {
tokenID: "tokenId",
const res = tokenMap.search('ergo', {
tokenID: 'tokenId',
});

@@ -55,7 +55,7 @@ (0, chai_1.expect)(res.length).to.be.eql(1);

});
it("should return empty array in case of wrong chain", () => {
it('should return empty array in case of wrong chain', () => {
const map = firstSample_json_1.default;
const tokenMap = new lib_1.TokenMap(map);
const res = tokenMap.search("bitcoin", {
tokenID: "tokenId",
const res = tokenMap.search('bitcoin', {
tokenID: 'tokenId',
});

@@ -65,4 +65,4 @@ (0, chai_1.expect)(res.length).to.be.eql(0);

});
describe("getID", () => {
it("should return ergo tokenId of tha passed token", () => {
describe('getID', () => {
it('should return ergo tokenId of tha passed token', () => {
const map = firstSample_json_1.default;

@@ -73,3 +73,3 @@ const tokenMap = new lib_1.TokenMap(map);

});
it("should return cardano fingerprint of tha passed token", () => {
it('should return cardano fingerprint of tha passed token', () => {
const map = firstSample_json_1.default;

@@ -80,3 +80,3 @@ const tokenMap = new lib_1.TokenMap(map);

});
it("tests that if idKeys is missed in the config throws error", () => {
it('tests that if idKeys is missed in the config throws error', () => {
const map = secondSample_json_1.default;

@@ -83,0 +83,0 @@ const tokenMap = new lib_1.TokenMap(map);

{
"name": "@rosen-bridge/tokens",
"version": "0.1.5",
"version": "0.1.6",
"description": "this project manage supported tokens",

@@ -8,8 +8,11 @@ "main": "dist/lib/index.js",

"scripts": {
"lint": "eslint --fix .",
"prettify": "prettier --write . --ignore-path ./.gitignore",
"lint": "eslint --fix . && npm run prettify",
"start": "npm run build && node dist/lib/index.js",
"build": "tsc",
"test": "tsc --noEmit && npm run lint && mocha -r ts-node/register 'tests/**/*.ts'",
"type-check": "tsc --noEmit",
"test": "mocha -r ts-node/register 'tests/**/*.ts'",
"coverage": "c8 npm run test",
"release": "npm run test && npm run build && npm publish --access public"
"release": "npm run test && npm run build && npm publish --access public",
"prepare": "husky install"
},

@@ -32,5 +35,9 @@ "repository": {

"c8": "^7.11.3",
"chai": "^4.3.6",
"eslint": "^8.16.0",
"chai": "^4.3.6",
"eslint-config-prettier": "^8.5.0",
"husky": "^8.0.0",
"lint-staged": "^13.0.3",
"mocha": "^10.0.0",
"prettier": "^2.7.1",
"ts-node": "^10.8.1",

@@ -45,3 +52,6 @@ "typescript": "^4.7.4"

"rosen"
]
],
"engines": {
"node": ">=16.14.0"
}
}

@@ -45,36 +45,46 @@ # tokens

***
---
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.

@@ -87,8 +97,11 @@

## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc