{"_id":"scorechain-sdk","_rev":"7-01d92325aec66cb06e3faaf8414a6c0b","name":"scorechain-sdk","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.1":{"name":"scorechain-sdk","version":"1.0.1","keywords":["scorechain","sdk","aml","cryptocurrency","blockchain","compliance","bitcoin","ethereum"],"author":{"name":"Scorechain"},"license":"MIT","_id":"scorechain-sdk@1.0.1","maintainers":[{"name":"scorechain","email":"infra@scorechain.com"}],"dist":{"shasum":"8bfcd6dcc1191e802f9721b23d799e6cd126613e","tarball":"https://registry.npmjs.org/scorechain-sdk/-/scorechain-sdk-1.0.1.tgz","fileCount":66,"integrity":"sha512-bKzb+aGA1kH8OnfnZ9UxM3gu5Bv971IVu86o1TO96aphqtOWXoyqA4yjrtnPB5pG+TIKjJ/wOFehSQ0GKeIbTw==","signatures":[{"sig":"MEUCIQCA47A+Uv5JE2PhNKxkc08jPpQxqUWFQF7C4o55JqR6dgIgK3rNGwRPUkM22RDpfFNoMgEsmR7jKLzyYhYrtDlQHH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117305},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":"^18.0.0"},"gitHead":"6d3f351c68a9a61354e63dd34e011195c3d505f6","scripts":{"lint":"eslint --config .eslintrc.json .","test":"jest -c jest.config.js --selectProjects unit integration e2e","build":"rm -rf ./dist && ./node_modules/.bin/tsc -p ./tsconfig.json","check":"tsc -p tsconfig.json --noEmit","format":"prettier --config .prettierrc --ignore-path .prettierignore -c .","cleanup":"rm -rf ./dist && mkdir ./dist","prepare":"husky install","lint:fix":"eslint --config .eslintrc.json --fix .","test:e2e":"jest -c jest.config.js --selectProjects e2e","test:unit":"jest -c jest.config.js --selectProjects unit","format:fix":"prettier --config .prettierrc --ignore-path .prettierignore --write .","install-clean":"rm -rf node_modules && rm -f package-lock.json && npm i","test:integration":"jest -c jest.config.js --selectProjects integration"},"_npmUser":{"name":"scorechain","email":"infra@scorechain.com"},"_npmVersion":"10.5.2","description":"SDK for the Scorechain API","directories":{},"lint-staged":{"src/**/*.[tj]s?(x)":["./node_modules/.bin/eslint --config .eslintrc.json --max-warnings 0 --fix"],"*(*.[tj]s?(x)|*.flow|*.json|*.?(s)css|*.less|*.html|*.vue|*.handlebars|*.md|*.yml)":["./node_modules/.bin/prettier --config .prettierrc --ignore-path .prettierignore --write"]},"_nodeVersion":"20.13.1","dependencies":{"axios":"^1.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","husky":"^8.0.3","eslint":"^8.50.0","esbuild":"^0.17.19","babel-jest":"^29.7.0","typescript":"^4.9.5","@babel/core":"^7.23.0","@types/jest":"^29.5.5","lint-staged":"^13.3.0","@babel/preset-env":"^7.22.20","eslint-plugin-jest":"^27.4.0","eslint-config-prettier":"^8.10.0","eslint-plugin-prettier":"^5.0.0","babel-plugin-jest-hoist":"29.2.0","@babel/preset-typescript":"^7.23.0","@typescript-eslint/parser":"^5.62.0","@typescript-eslint/eslint-plugin":"^5.62.0"},"_npmOperationalInternal":{"tmp":"tmp/scorechain-sdk_1.0.1_1717420243771_0.5550531309119009","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"scorechain-sdk","version":"1.0.2","keywords":["scorechain","sdk","aml","cryptocurrency","blockchain","compliance","bitcoin","ethereum"],"author":{"name":"Scorechain"},"license":"MIT","_id":"scorechain-sdk@1.0.2","maintainers":[{"name":"scorechain","email":"infra@scorechain.com"}],"dist":{"shasum":"c7bf474e764004e542a734f2fc7de80cc268c537","tarball":"https://registry.npmjs.org/scorechain-sdk/-/scorechain-sdk-1.0.2.tgz","fileCount":66,"integrity":"sha512-V1Nn9izZ9vRW3qwyIlNvgTskY4A/qyTdOtEE9G83r54OloBZIX14tB+xZcSUWMArtENwzLRH4ceWJPPMJLqqGw==","signatures":[{"sig":"MEUCIGOMZ+BSOn6gFFKkbmN4C10qUCbPNL8ATVzhlmBJ9hpLAiEAhgeuMwcElJ8k8ZatUoG5O+CIE3w5ejFeOs8fjdXrCqk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":117306},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"d180d4ea27318ee81649161ddc401e4a0d379f5d","scripts":{"lint":"eslint --config .eslintrc.json .","test":"jest -c jest.config.js --selectProjects unit integration e2e","build":"rm -rf ./dist && ./node_modules/.bin/tsc -p ./tsconfig.json","check":"tsc -p tsconfig.json --noEmit","format":"prettier --config .prettierrc --ignore-path .prettierignore -c .","cleanup":"rm -rf ./dist && mkdir ./dist","prepare":"husky install","lint:fix":"eslint --config .eslintrc.json --fix .","test:e2e":"jest -c jest.config.js --selectProjects e2e","test:unit":"jest -c jest.config.js --selectProjects unit","format:fix":"prettier --config .prettierrc --ignore-path .prettierignore --write .","install-clean":"rm -rf node_modules && rm -f package-lock.json && npm i","test:integration":"jest -c jest.config.js --selectProjects integration"},"_npmUser":{"name":"scorechain","email":"infra@scorechain.com"},"_npmVersion":"10.5.2","description":"SDK for the Scorechain API","directories":{},"lint-staged":{"src/**/*.[tj]s?(x)":["./node_modules/.bin/eslint --config .eslintrc.json --max-warnings 0 --fix"],"*(*.[tj]s?(x)|*.flow|*.json|*.?(s)css|*.less|*.html|*.vue|*.handlebars|*.md|*.yml)":["./node_modules/.bin/prettier --config .prettierrc --ignore-path .prettierignore --write"]},"_nodeVersion":"20.13.1","dependencies":{"axios":"^1.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","husky":"^8.0.3","eslint":"^8.50.0","esbuild":"^0.17.19","babel-jest":"^29.7.0","typescript":"^4.9.5","@babel/core":"^7.23.0","@types/jest":"^29.5.5","lint-staged":"^13.3.0","@babel/preset-env":"^7.22.20","eslint-plugin-jest":"^27.4.0","eslint-config-prettier":"^8.10.0","eslint-plugin-prettier":"^5.0.0","babel-plugin-jest-hoist":"29.2.0","@babel/preset-typescript":"^7.23.0","@typescript-eslint/parser":"^5.62.0","@typescript-eslint/eslint-plugin":"^5.62.0"},"_npmOperationalInternal":{"tmp":"tmp/scorechain-sdk_1.0.2_1717421099492_0.8061732803974391","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"scorechain-sdk","version":"1.0.3","keywords":["scorechain","sdk","aml","cryptocurrency","blockchain","compliance","bitcoin","ethereum"],"author":{"name":"Scorechain"},"license":"MIT","_id":"scorechain-sdk@1.0.3","maintainers":[{"name":"scorechain","email":"infra@scorechain.com"}],"dist":{"shasum":"0d9f22f2cbd431ed4b12be002571926164662d91","tarball":"https://registry.npmjs.org/scorechain-sdk/-/scorechain-sdk-1.0.3.tgz","fileCount":77,"integrity":"sha512-TzEHe8HClXyvrTGuKZyl5uMvH6d7dx3p4unu2XMmyfR/NOsOr0XlKkI5OxrvGNqYLEdsw9wPWewYTp7etr2PxA==","signatures":[{"sig":"MEUCIECvMHrsqErMx+wDtu1pyVSnNgsObzu/DDgKE8+lmPedAiEAmbGIzWxsbp58F2JZRnvGH+6PHTUrEzxP1Sm26eeR6vc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":138387},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"88fc3e3bd181ca74c67cb8577d3ec4f5fe6beb3d","scripts":{"lint":"eslint --config .eslintrc.json .","test":"jest -c jest.config.js --selectProjects unit integration e2e","build":"rm -rf ./dist && ./node_modules/.bin/tsc -p ./tsconfig.json","check":"tsc -p tsconfig.json --noEmit","format":"prettier --config .prettierrc --ignore-path .prettierignore -c .","cleanup":"rm -rf ./dist && mkdir ./dist","prepare":"husky install","lint:fix":"eslint --config .eslintrc.json --fix .","test:e2e":"jest -c jest.config.js --selectProjects e2e","test:unit":"jest -c jest.config.js --selectProjects unit","format:fix":"prettier --config .prettierrc --ignore-path .prettierignore --write .","install-clean":"rm -rf node_modules && rm -f package-lock.json && npm i","test:integration":"jest -c jest.config.js --selectProjects integration"},"_npmUser":{"name":"scorechain","email":"infra@scorechain.com"},"_npmVersion":"10.8.2","description":"SDK for the Scorechain API","directories":{},"lint-staged":{"src/**/*.[tj]s?(x)":["./node_modules/.bin/eslint --config .eslintrc.json --max-warnings 0 --fix"],"*(*.[tj]s?(x)|*.flow|*.json|*.?(s)css|*.less|*.html|*.vue|*.handlebars|*.md|*.yml)":["./node_modules/.bin/prettier --config .prettierrc --ignore-path .prettierignore --write"]},"_nodeVersion":"20.18.1","dependencies":{"axios":"^1.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","husky":"^8.0.3","eslint":"^8.50.0","esbuild":"^0.17.19","babel-jest":"^29.7.0","typescript":"^4.9.5","@babel/core":"^7.23.0","@types/jest":"^29.5.5","lint-staged":"^13.3.0","@babel/preset-env":"^7.22.20","eslint-plugin-jest":"^27.4.0","eslint-config-prettier":"^8.10.0","eslint-plugin-prettier":"^5.0.0","babel-plugin-jest-hoist":"29.2.0","@babel/preset-typescript":"^7.23.0","@typescript-eslint/parser":"^5.62.0","@typescript-eslint/eslint-plugin":"^5.62.0"},"_npmOperationalInternal":{"tmp":"tmp/scorechain-sdk_1.0.3_1738069470063_0.34653934065893677","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2024-06-03T13:10:43.770Z","modified":"2026-04-23T14:11:16.930Z","1.0.0":"2024-05-24T11:45:56.715Z","1.0.1":"2024-06-03T13:10:43.928Z","1.0.2":"2024-06-03T13:24:59.654Z","1.0.3":"2025-01-28T13:04:30.253Z"},"author":{"name":"Scorechain"},"license":"MIT","keywords":["scorechain","sdk","aml","cryptocurrency","blockchain","compliance","bitcoin","ethereum"],"description":"SDK for the Scorechain API","maintainers":[{"email":"gregoire.marchal@scorechain.com","name":"scorchain-greg"},{"email":"infra@scorechain.com","name":"scorechain-infra"},{"email":"denis.santangelo@scorechain.com","name":"denis.santangelo"}],"readme":"\n<div align=\"center\" style=\"margin-bottom: 50px;\">\n    <img\n    width=\"400px\" alt=\"scorechain-logo\"\n    src=\"https://uploads-ssl.webflow.com/654506076ba62ddb88e1876a/661f94783b31fa546c29ab11_Scorechain%20-%20Logo_for_mail.png\"  alt=\"Scorechain logo\">\n</div>\n\n\n# Scorechain SDK for javascript\n\nThe goal of the Scorechain SDK for JavaScript is to simplify the integration of the Scorechain API into JavaScript applications. By providing a set of convenient functions and methods, developers can easily interact with the Scorechain API and access its features. This SDK aims to streamline the process of integrating Scorechain's blockchain analytics capabilities into JavaScript projects, enabling developers to leverage the power of Scorechain's technology with ease.\n\n## Getting Started\n\n### How to install\n\n```sh\nnpm install scorechain-sdk --save\n```\n\n\n### Usage\n\n- With Typescript\n```ts\nimport { ScorechainConnector } from \"scorechain-sdk\";\nconst connector = new ScorechainConnector(\"MyScorechainApiKey\");\n```\n\n- With Javascript\n```js\nconst { ScorechainConnector } = require(\"scorechain-sdk\")\nconst connector = new ScorechainConnector(\"MyScorechainApiKey\");\n```\n\nAll methods in the connector are wrapper for endpoints of the <a href=\"https://tech-doc.api.scorechain.com\">Scorechain API</a> :\n\n- **getTransaction**:\n<br/>&nbsp;&nbsp;&nbsp;&nbsp;Retrieve a transaction by its hash from the specified blockchain.\n- **getAddress**:\n<br/>&nbsp;&nbsp;&nbsp;&nbsp;Retrieve information about a specific address from the blockchain.\n- **getTransactionScoringAnalysis**:\n<br/>&nbsp;&nbsp;&nbsp;&nbsp;Get a real-time scoring analysis for a transaction.\n- **getAddressScoringAnalysis**:\n<br/>&nbsp;&nbsp;&nbsp;&nbsp;Get a real-time scoring analysis for a specific address.\n- **getWalletScoringAnalysis**:\n<br/>&nbsp;&nbsp;&nbsp;&nbsp;Get a real-time scoring analysis for a wallet.\n- **feedTransaction**:\n<br/>&nbsp;&nbsp;&nbsp;&nbsp;Feed a transaction for analysis by risk scenarios.\n- **feedWithdrawal**:\n<br/>&nbsp;&nbsp;&nbsp;&nbsp;Feed a not approved withdrawal for analysis by risk scenarios.\n\n\n### Proof of Authenticity\n\nThe ScorechainConnector includes built-in proof of authenticity checks, which validate response signatures to ensure secure communication. If you prefer to disable these checks, you can initialize the connector as follows:\n```ts\nconst connector = new ScorechainConnector(\"MyScorechainApiKey\", false);\n```\n\n#### Public Key\n\nIn case Scorechain has to renew its private key, the recommended procedure is to update the SDK to the latest version. However, to ensure continuity, we provide a convenience function to refresh the embedded public key. This should only be used in case of emergency:\n\n```ts\nconst connector = new ScorechainConnector(\"MyScorechainApiKey\");\nawait connector.updateScorechainPublicKey();\n```\n\n## Example\n\nHere is a simple example to send a transaction to the Transaction Monitoring System\n\n```ts\nconst connector = new ScorechainConnector(\"MyScorechainApiKey\")\nconst txid = \"0x308b22a8e0e9e4e7d1b9fd1dfab74d7b37325b255e566f4d81edd457937c5e0c\"\nconst address = \"0x9f5A8089ecF94d3D4D7A53025d993E0cc29e2c5f\"\n\nconnector.feedTransaction(txid, BlockchainEnum.ETHEREUM, ScoringDirection.INCOMING, address)\n```\n\nHere is a simple example of an address screening that you can call after detecting a deposit.\n\n```ts\nimport { BlockchainEnum, ScorechainConnector, ScoringAnalysisType, SeverityEnum } from \"scorechain-sdk\";\n\n(async () => {\n    const connector = new ScorechainConnector(\"MyScorechainApiKey\")\n    const txid = \"0x308b22a8e0e9e4e7d1b9fd1dfab74d7b37325b255e566f4d81edd457937c5e0c\"\n    const tx = await connector.getTransaction(txid, BlockchainEnum.ETHEREUM);\n    const addressScore = await connector.getAddressScoringAnalysis(\n        tx.operations[0].destinations[0].address,\n        BlockchainEnum.ETHEREUM,\n        \"MAIN\",\n        ScoringAnalysisType.INCOMING,\n        6\n    );\n    const severity = Object.keys(addressScore.analysis).reduce(\n        (acc, analysis) => {\n            if (addressScore.analysis[analysis]?.result?.score === addressScore.lowestScore) {\n                acc = addressScore.analysis[analysis].result.severity;\n            }\n            return acc;\n        },\n        SeverityEnum.UNDEFINED_RISK\n    )\n\n    if (severity !== SeverityEnum.CRITICAL_RISK && severity !== SeverityEnum.HIGH_RISK) {\n        console.log(\"Transaction is safe\");\n    } else {\n        console.log(\"Transaction is risky\");\n    }\n})()\n```\n","readmeFilename":"README.md"}