{"id":20713629,"url":"https://github.com/xuperchain/xuper-sdk-js","last_synced_at":"2025-07-27T12:20:31.881Z","repository":{"id":38584751,"uuid":"229175769","full_name":"xuperchain/xuper-sdk-js","owner":"xuperchain","description":"The JS(TS) SDK for XuperChain","archived":false,"fork":false,"pushed_at":"2024-03-13T11:46:40.000Z","size":11448,"stargazers_count":14,"open_issues_count":25,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T08:08:08.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://xuperchain.github.io/xuper-sdk-js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuperchain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-20T02:34:19.000Z","updated_at":"2024-03-11T01:32:52.000Z","dependencies_parsed_at":"2024-01-12T20:50:04.064Z","dependency_job_id":"93f4ae95-ab6e-48bb-8410-6adb9a319283","html_url":"https://github.com/xuperchain/xuper-sdk-js","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuperchain%2Fxuper-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuperchain%2Fxuper-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuperchain%2Fxuper-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuperchain%2Fxuper-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuperchain","download_url":"https://codeload.github.com/xuperchain/xuper-sdk-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250395288,"owners_count":21423400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T02:26:22.301Z","updated_at":"2025-04-23T08:08:15.782Z","avatar_url":"https://github.com/xuperchain.png","language":"TypeScript","funding_links":[],"categories":["Development Tutorial"],"sub_categories":["Consortium Blockchain"],"readme":"# Xuper SDK JS\n\n[![Build Status](https://travis-ci.org/xuperchain/xuper-sdk-js.svg?branch=master)](https://travis-ci.org/xuperchain/xuper-sdk-js)\n[![npm version](https://badge.fury.io/js/%40xuperchain%2Fxuper-sdk.svg)](https://badge.fury.io/js/%40xuperchain%2Fxuper-sdk)\n\nXuper SDK (JS/TS) is a software development kit that allows developers to quickly use XuperChain.\n\nThe SDK provides a service interface that includes account, transaction, contract and various query functions. It can be used in a browser and Nodejs environment.\n\n---\n\nEnglish | [简体中文](./README_zh-CN.md)\n\n## Usage\n\n### Install Npm package\n\n\u003e npm install --save @xuperchain/xuper-sdk\n\n### Quick start\n\n```javascript\nimport XuperSDK from '@xuperchain/xuper-sdk';\n\nconst node = ''; // node\nconst chain = ''; // chain\n\nconst xsdk = XuperSDK.getInstance({\n    node,\n    chain\n});\n\nconst start = async () =\u003e {\n    const result = await xsdk.getBlockChains();\n    console.log(result);\n};\n\nstart();\n```\n\n*[Details - API reference](#api-reference-documentation)*\n\n\n### Code examples\n\n[![Edit xuper-sdk-demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/xuper-sdk-demo-q5m93?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n\n### Environments\n\n- Browser depends on window.crypto\n- Nodejs \u003e= v10.0\n\n##### In the Nodejs environment, **gRPC** is supported and used by default, you can choose to close it, and still use Http to request\n```javascript\nXuperSDK.getInstance({\n    ...,\n    env: {\n        node: {\n            disableGRPC: true // disable gRPC\n        }\n    }\n})\n```\n\n### How to build a test environment\n\n#### Read the [documentation](https://github.com/xuperchain/xuperchain) , compile and deploy XuperChain\n\n#### Use XuperChain Docker image to build a single-node service\n\n1. Pull image (*XuperChian v3.7 - [Repository](https://github.com/SmilingXinyi/xuperchain)*)\n\u003e docker pull smilingxinyi/xuperchain\n\n2. Start container\n\u003e docker run -d -p 8098:8098  -p 37101:37101 -p 47101:47101 --name xc smilingxinyi/xuperchain\n\n## API reference documentation\n\n[Link](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html)\n\n## Services\n\n### Account\n\nservice|name|link|state\n---|---|---|:---:\nCreate account|create|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#create)|√\nRetrieve account|retrieve|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#retrieve)|√\nImport private key|import|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#import)|√\nExport private key|export|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#export)|√\nChekc address|checkAddress|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#checkaddress)|√\nCheck mnemonic|checkMnemonic|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#checkmnemonic)|√\nBalance|getBalance|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#getbalance)|√\nBalance Detail|getBalanceDetail|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#getbalanceDetail)|√\n\n### Blockchain infomation\n\nservice|name|link|state\n---|---|---|:---:\nBlockchains|getBlockChains|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#getBlockChains)|√\nStatus|checkStatus|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#checkStatus)|√\nBlock by id|getBlockById|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#getBlockById)|√\nBlock by height|getBlockByHeight|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#getBlockByHeight)|√\n\n### Transaction\n\nservice|name|link|state\n---|---|---|:---:\nMake transfer|transfer|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#transfer)|√\nPost tx|postTransaction|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#postTransaction)|√\nQuery tx|queryTransaction|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#queryTransaction)|√\n\n### Contract\n\nservice|name|link|state\n---|---|---|:---:\nNew contract account|createContractAccount|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#createContractAccount)|√\nContract list|getContracts|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#getContracts)|√\nDeploy Wasm contract|deployWasmContract|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#deployWasmContract)|√\nInvoke Wasm contarct|invokeContarct|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#invokeContarct)|√\nDeploy Solidity contract|deploySolidityContract|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#deploySolidityContract)|√\nInvoke Solidity contarct|invokeSolidityContarct|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#invokeSolidityContarct)|√\nDeploy Native contract|deployNativeContract|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#deployNativeContract)|√\nInvoke Native contarct|invokeContarct|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#invokeContarct)|√\nQuery ACL|queryACL|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#queryACL)|√\nQuery stat data about contract|queryContractStatData|[LINK](https://xuperchain.github.io/xuper-sdk-js/classes/xupersdk.html#queryContractStatData)|√\n\n## Plugin\n\n#### Endorsement service plugin\n\n\u003e The plugin must be used on the `public network`\n\n##### EndorsementPlugin\n\nExample:\n\n```javascript\n\nconst params = {\n    server: process.env.ENDORSE_SERVER, // ip, port\n    fee: process.env.FEE, // fee\n    endorseServiceCheckAddr: process.env.SERVICE_SIGN_ADDRESS, // sign address\n    endorseServiceFeeAddr: process.env.SERVICE_FEE_ADDRESS // fee address\n}\n\nconst xsdk = new XuperSDK({\n    node,\n    chain,\n    plugins: [\n        EndorsementPlugin({\n            transfer: params,\n            makeTransaction: params\n        })\n    ]\n});\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuperchain%2Fxuper-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuperchain%2Fxuper-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuperchain%2Fxuper-sdk-js/lists"}