{"id":18966891,"url":"https://github.com/tronprotocol/sun.js","last_synced_at":"2025-04-19T14:22:20.451Z","repository":{"id":92595220,"uuid":"241263405","full_name":"tronprotocol/sun.js","owner":"tronprotocol","description":null,"archived":false,"fork":false,"pushed_at":"2020-04-14T04:01:21.000Z","size":1401,"stargazers_count":5,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-16T08:10:44.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tronprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-18T03:27:52.000Z","updated_at":"2024-12-09T11:43:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"42f41416-47d8-4f1f-8ac2-cf300e45cabb","html_url":"https://github.com/tronprotocol/sun.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fsun.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fsun.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fsun.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fsun.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tronprotocol","download_url":"https://codeload.github.com/tronprotocol/sun.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249711270,"owners_count":21314200,"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-08T14:38:59.455Z","updated_at":"2025-04-19T14:22:20.440Z","avatar_url":"https://github.com/tronprotocol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is Sun.js\n\nSun.js inherits from TronWeb and services for Sun-network. We  encapsulated two objects (mainchain and sidechain) based on TronWeb. The methods and attributes in mainchain or sidechain are exactly the same as the tronweb instance. For example, users can use sun.mainchain.trx.getBalance() to get balance from the mainchain. Futhermore, we add some new methods which are as follows in Sun class so that users can use them to contact between the main chain and the side chain. \n\n# Installation\n\n\u003cstrong\u003eNode.js\u003c/strong\u003e\n\n```javascript\nnpm install sun\n```\n\nor\n\n```javascript\nyarn add sun\n```\n\n\u003cstrong\u003eBrowser\u003c/strong\u003e\n\nThen easiest way to use Sun.js in a browser is to install it as above and copy the dist file to your working folder. For example:\n\n```javascript\ncp node_modules/sun/dist/Sun.js ./js/Sun.js\n```\n\nso that you can call it in your HTML page as\n\n```javascript\n\u003cscript src=\"./js/Sun.js\"\u003e\u003cscript\u003e\n```\n# Test cases\n\n```javascript\nnpm run test\n```\nBut before run test cases, you must add some info in test/config.js, such fullnode, solidity node, eventsever and private key.\n\n# Documentation\n\n[Sun](http://47.252.84.158:8080/sunnetwork/doc/guide/#sunweb-class)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronprotocol%2Fsun.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftronprotocol%2Fsun.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronprotocol%2Fsun.js/lists"}