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.4 to 0.1.5

dist/tests/RosenTokens.d.ts

1

dist/lib/index.d.ts
export { TokenMap } from "./TokenMap/TokenMap";
export { RosenTokens } from "./TokenMap/types";

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

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

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

*/
constructor(tokens?: TokensMap);
constructor(tokens: RosenTokens);
/**

@@ -28,2 +28,24 @@ * it returns specific token with respect to condition on the specific chain

}[];
/**
* returns tokenId in specific chain with respect to idKeys in the tokensConfig
* @param token
* example: {
* "ergo": {
* "tokenID": "tokenId",
* "tokenName": "token1"
* },
* "cardano": {
* "fingerprint": "...",
* "policyID": "policy",
* "assetID": "id"
* }
* }
* @param chain
* example: "cardano"
*/
getID: (token: {
[key: string]: {
[key: string]: string;
};
}, chain: string) => string;
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TokenMap = void 0;
const tokensList_json_1 = __importDefault(require("../tokensList/tokensList.json"));
/**

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

*/
constructor(tokens = tokensList_json_1.default) {
constructor(tokens) {
this.tokensConfig = tokens;

@@ -45,3 +41,29 @@ }

};
/**
* returns tokenId in specific chain with respect to idKeys in the tokensConfig
* @param token
* example: {
* "ergo": {
* "tokenID": "tokenId",
* "tokenName": "token1"
* },
* "cardano": {
* "fingerprint": "...",
* "policyID": "policy",
* "assetID": "id"
* }
* }
* @param chain
* example: "cardano"
*/
getID = (token, chain) => {
if (Object.hasOwnProperty.call(this.tokensConfig.idKeys, chain)) {
const idKey = this.tokensConfig.idKeys[chain];
return token[chain][idKey];
}
else {
throw new Error(`idKey of the ${chain} chain is missed in the config file`);
}
};
}
exports.TokenMap = TokenMap;

5

dist/lib/TokenMap/types.d.ts

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

export declare type TokensMap = {
export declare type RosenTokens = {
idKeys: {
[key: string]: string;
};
tokens: Array<{

@@ -3,0 +6,0 @@ [key: string]: {

{
"idKeys": {
"ergo": "tokenID",
"cardano": "fingerprint"
},
"tokens": [

@@ -3,0 +7,0 @@ {

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

@@ -5,0 +5,0 @@ "main": "dist/lib/index.js",

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