{"id":13796247,"url":"https://github.com/vechain/thorify","last_synced_at":"2025-05-13T00:30:44.732Z","repository":{"id":31989665,"uuid":"130986647","full_name":"vechain/thorify","owner":"vechain","description":"A web3 adaptor for VeChain Thor RESTful HTTP API.","archived":true,"fork":false,"pushed_at":"2024-04-09T15:11:34.000Z","size":1250,"stargazers_count":71,"open_issues_count":1,"forks_count":37,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-01T15:02:47.834Z","etag":null,"topics":["blockchain","contracts","smart","thor","vechain","web3"],"latest_commit_sha":null,"homepage":"https://thorify.vecha.in/","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vechain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2018-04-25T09:59:32.000Z","updated_at":"2025-01-27T15:22:38.000Z","dependencies_parsed_at":"2024-01-13T10:41:41.055Z","dependency_job_id":"5cbb750b-616c-432e-864e-e17bd59c6d28","html_url":"https://github.com/vechain/thorify","commit_stats":{"total_commits":280,"total_committers":14,"mean_commits":20.0,"dds":0.2321428571428571,"last_synced_commit":"72988996cead74f9c73e38860c2e055ca35a108e"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vechain%2Fthorify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vechain%2Fthorify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vechain%2Fthorify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vechain%2Fthorify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vechain","download_url":"https://codeload.github.com/vechain/thorify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745150,"owners_count":21957317,"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":["blockchain","contracts","smart","thor","vechain","web3"],"created_at":"2024-08-03T23:01:07.905Z","updated_at":"2025-05-13T00:30:44.092Z","avatar_url":"https://github.com/vechain.png","language":"TypeScript","funding_links":[],"categories":["Developer resources"],"sub_categories":["Blockchain development"],"readme":"## Thorify \n\u003e [!IMPORTANT]\n\u003e This project is discontinued, try out [web3-providers-connex](https://github.com/vechain/web3-providers-connex) or [vechain-sdk-js](https://github.com/vechain/vechain-sdk-js).\n\n[![NPM Version](https://badge.fury.io/js/thorify.svg)](https://www.npmjs.com/package/thorify)\n[![Build Status](https://travis-ci.org/vechain/thorify.svg)](https://travis-ci.org/vechain/thorify)\n[![Coverage Status](https://coveralls.io/repos/github/vechain/thorify/badge.svg?branch=master)](https://coveralls.io/github/vechain/thorify?branch=master)\n\nA web3 adaptor for VeChain [Thor](https://github.com/vechain/thor) RESTful API.\n\n## Table of contents\n\n* [Install](#install)\n* [Usage](#usage)\n* [Web3 method supported](#web3-method-supported)\n* [Send transaction](#send-transaction)\n* [Documentation](https://thorify.vecha.in)\n* [Play with multi-clause](#play-with-multi-clause)\n* [Which Stack Should I Choose Regarding Connex,Thorify And Web3-Gear](#which-stack-should-i-choose-regarding-connexthorify-and-web3-gear)\n* [FAQ](#faq)\n    * [Web3-Gear vs Thorify](#web3-gear-vs-thorify)\n    * [How do I send VTHO token](#how-do-i-send-vtho-token)\n    * [Multi party payment protocol or sponsored contract](#multi-party-payment-protocol-or-sponsored-contract)\n    * [Method not supported](#method-not-supported)\n    * [Subscriptions support](#subscriptions-support)\n* [Notes](#notes)\n* [Compatibility](#compatibility)\n* [Debugging](#debugging)\n* [License](#License)\n\n## Install\n\n``` bash\nnpm i thorify web3@1.* # Web3 is needed as dependency.\n```\n\nFurthermore, if you would like to change web3 version after installation, for example `1.6`, run `npm i web3@1.6 web3-core-subscriptions@1.6` as `subscriptions` is a peer dependency.\n\n## Usage\n\n``` javascript\n// ES6 style\nimport { thorify } from \"thorify\";\nconst Web3 = require(\"web3\");\t\t// Recommend using require() instead of import here\n\nconst web3 = thorify(new Web3(), \"http://localhost:8669\");\n\nweb3.eth.getBlock(\"latest\").then(res =\u003e console.log(res));\n// Best block info will be displayed\n```\n\nIf you would like to write code in ES5, check below for the initialization code.\n\n``` javascript\n// ES5 style\nconst thorify = require(\"thorify\").thorify;\nconst Web3 = require(\"web3\");\n\nconst web3 = thorify(new Web3(), \"http://localhost:8669\");\n\nweb3.eth.getBlock(\"latest\").then(res =\u003e console.log(res));\n// Best block info will be displayed\n```\n\n## Web3 method supported\n\n```\nweb3 instance\n├── eth\n│   ├── getBlockNumber\n│   ├── getBalance\n│   ├── getStorageAt\n│   ├── getCode\n│   ├── getBlock\n│   ├── getTransaction\n│   ├── getTransactionReceipt\n│   ├── sendTransaction\n│   ├── sendSignedTransaction\n│   ├── call\n│   ├── estimateGas\n│   ├── getPastLogs\n│   ├── subscribe\n│   ├── clearSubscriptions\n│   ├── getEnergy\n│   ├── getChainTag\n│   ├── getBlockRef\n│   ├── accounts\n│   └── Contract\n│       ├── Constructor(new Contract())\n│       ├── clone\n│       ├── deploy\n│       ├── methods\n│       ├── methods.myMethod.call\n│       ├── methods.myMethod.send\n│       ├── methods.myMethod.estimateGas\n│       ├── methods.myMethod.encodeABI\n│       ├── events\n│       ├── once\n│       ├── events.myEvent\n│       ├── events.allEvents\n│       └── getPastEvents\n└── utils\n\n```\n\n## Send Transaction\n\nIn Thor official implementation , the client **DOES NOT** neither manage user's private-key/keyStore nor use private key to sign a Transaction. Unfortunately, thorify can not directly perform `eth_sendTransaction` but there is another way to sign a transaction.\n\nIn [web3.js accounts](https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#eth-accounts), it gives the opportunity to add your private-key, stored in your runtime context (In Node.js context, it's stored in memory while in Browser context, it's stored in memory/local storage), to accounts module. When you are trying to send a transaction, the module will check the private key associated with from field. Once the private key and from have been matched, the module will sign the transaction.\nThe APIs that follows the mechanism are:\n\n+ `web3.eth.sendTransaction()`\n+ `contract.deploy.send()`\n+ `contract.methods.myMethod.send()`\n\n## Documentation\n\n[API Reference](https://thorify.vecha.in/#/?id=api-reference)\n\n## Play with multi-clause\n\n1. [thor-devkit.js](https://github.com/vechain/thor-devkit.js) supports multi-clause and sign transaction\n2. send signed transaction using [sendSignedTransaction](https://thorify.vecha.in/#/?id=send-signed-transaction)\n\n## FAQ\n\n### How do I send VTHO token\n\nVTHO is a token that compatible with VIP180(ERC-20), you can build a contract instance using `web3` and do what ever you want.\n\n+ [VTHO source code](https://github.com/vechain/thor/blob/master/builtin/gen/energy.sol)\n+ Contract Address: `0x0000000000000000000000000000456E65726779`\n\n### Multi party payment protocol or sponsored contract\n\nIt's done by calling the functions of prototype contract, check [wiki page](https://github.com/vechain/thor/wiki/Prototype(EN)) for detailed info about prototype contract.\n\n### Method not supported\n\nThe RESTful API of Thor is different with Ethereum's JSON-RPC, therefore, there are some methods in web3 are not supported by thorify, feel free to open an issue discuss the features.\n\n## Notes\n\n- There are three special block number in Ethereum: `earliest`,`latest`,`pending`. In VeChain Thor, we introduced `best` block and there is no `pending` block, so they will be replaced with `0` (aka genesis), `best`, `best`\n\n## Compatibility\n\nCurrently, `Thorify` is compatible with `web3@1.*`, tested versions are `1.2~1.7.1`.\n\n## Debugging\n\n```shell\nDEBUG=thor:* ts-node index.ts \n```\n\n`ts-node index.ts` can be replaced with command to run your code, this example is only for Node.js environment. For more detailed info, please refer to [debug](https://www.npmjs.com/package/debug).\n\n\n## License\n\nThis project is licensed under the MIT license, Copyright (c) 2017 VeChain Foundation. For more information see [LICENSE.md](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvechain%2Fthorify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvechain%2Fthorify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvechain%2Fthorify/lists"}