Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup cleanup #2

Open
wants to merge 8 commits into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
npm-debug.log
.npm/
/coverage
packages/web3-tolar/coverage/
/tmp
node_modules
.idea/
Expand All @@ -21,3 +22,12 @@ contracts/
migrations/
truffle-config.js
test/config/ensAddresses.json
packages/web3-tolar/coverage
packages/web3-tolar/coverage/
packages/web3-tolar/coverage/lcov.info
packages/web3-tolar/coverage/lcov-report/index.html
packages/web3-tolar/coverage/lcov-report/src/index.html
packages/web3-tolar/coverage/lcov-report/src/index.ts.html
packages/web3-tolar/coverage/lcov-report/tests/index.html
packages/web3-tolar/coverage/lcov-report/tests/index.test.ts.html
packages/web3-tolar/coverage/lcov.info
86 changes: 15 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
<img src="assets/logo/web3js.jpg" width="200" alt="web3.js" />
</p>

# web3.js - Ethereum JavaScript API
# web3t - Tolar JavaScript API

[![Gitter][gitter-image]][gitter-url] [![StackExchange][stackexchange-image]][stackexchange-url] [![NPM Package Version][npm-image-version]][npm-url] [![NPM Package Downloads][npm-image-downloads]][npm-url] [![Build Status][travis-image]][travis-url] [![Dev Dependency Status][deps-dev-image]][deps-dev-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Lerna][lerna-image]][lerna-url]

This is the Ethereum [JavaScript API][docs]
This is the Tolar [JavaScript API][docs]
which connects to the [Generic JSON-RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC) spec.

You need to run a local or remote [Ethereum](https://www.ethereum.org/) node to use this library.
You need to run a local or remote [Tolar](https://www.tolar.io/) node to use this library.

Please read the [documentation][docs] for more.

Expand All @@ -18,19 +16,13 @@ Please read the [documentation][docs] for more.
### Node

```bash
npm install web3
```

### Yarn

```bash
yarn add web3
npm install @dreamfactoryhr/web3t
```

### In the Browser

Use the prebuild `dist/web3.min.js`, or
build using the [web3.js][repo] repository:
build using the [web3t][repo] repository:

```bash
npm run-script build
Expand All @@ -39,25 +31,13 @@ npm run-script build
Then include `dist/web3.js` in your html file.
This will expose `Web3` on the window object.

Or via jsDelivr CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
```

UNPKG:

```html
<script src="https://unpkg.com/web3@latest/dist/web3.min.js"></script>
```

## Usage

```js
// in node.js
var Web3 = require('web3');
var Web3 = require('@dreamfactoryhr/web3t');

var web3 = new Web3('ws://localhost:8546');
var web3 = new Web3('https://...');
console.log(web3);
> {
eth: ... ,
Expand All @@ -70,9 +50,9 @@ console.log(web3);
Additionally you can set a provider using `web3.setProvider()` (e.g. WebsocketProvider):

```js
web3.setProvider('ws://localhost:8546');
web3.setProvider("https://...");
// or
web3.setProvider(new Web3.providers.WebsocketProvider('ws://localhost:8546'));
web3.setProvider(new Web3.providers.WebsocketProvider("https://..."));
```

There you go, now you can use it:
Expand All @@ -85,11 +65,11 @@ web3.eth.getAccounts().then(console.log);

We support types within the repo itself. Please open an issue here if you find any wrong types.

You can use `web3.js` as follows:
You can use `web3t` as follows:

```typescript
import Web3 from 'web3';
const web3 = new Web3('ws://localhost:8546');
import Web3 from "web3";
const web3 = new Web3("https://...");
```

If you are using the types in a `commonjs` module like for example a node app you just have to enable `esModuleInterop` in your `tsconfig` compile option, also enable `allowSyntheticDefaultImports` for typesystem compatibility:
Expand Down Expand Up @@ -140,42 +120,6 @@ This will put all the browser build files into the `dist` folder.
npm test
```

### Contributing

The contribution guidelines are provided in [CONTRIBUTIONS](./CONTRIBUTIONS.md)

### Community

- [Gitter][gitter-url]
- [StackExchange][stackexchange-url]
- [Forum](https://forum.ethereum.org/categories/ethereum-js)

### Similar libraries in other languages

- Haskell: [hs-web3](https://github.com/airalab/hs-web3)
- Java: [web3j](https://github.com/web3j/web3j)
- PHP: [web3.php](https://github.com/sc0Vu/web3.php)
- Purescript: [purescript-web3](https://github.com/f-o-a-m/purescript-web3)
- Python: [Web3.py](https://github.com/ethereum/web3.py)
- Ruby: [ethereum.rb](https://github.com/EthWorks/ethereum.rb)
- Scala: [web3j-scala](https://github.com/mslinn/web3j-scala)

[repo]: https://github.com/ethereum/web3.js
[docs]: http://web3js.readthedocs.io/
[npm-image-version]: https://img.shields.io/npm/v/web3.svg
[npm-image-downloads]: https://img.shields.io/npm/dm/web3.svg
[npm-url]: https://npmjs.org/package/web3
[travis-image]: https://travis-ci.org/ethereum/web3.js.svg?branch=1.x
[travis-url]: https://travis-ci.org/ethereum/web3.js?branch=1.x
[deps-dev-image]: https://david-dm.org/ethereum/web3.js/1.x/dev-status.svg
[deps-dev-url]: https://david-dm.org/ethereum/web3.js/1.x?type=dev
[coveralls-image]: https://coveralls.io/repos/ethereum/web3.js/badge.svg?branch=1.x
[coveralls-url]: https://coveralls.io/r/ethereum/web3.js?branch=1.x
[waffle-image]: https://badge.waffle.io/ethereum/web3.js.svg?label=ready&title=Ready
[waffle-url]: https://waffle.io/ethereum/web3.js
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/ethereum/web3.js
[lerna-image]: https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg
[lerna-url]: https://lerna.js.org/
[stackexchange-image]: https://img.shields.io/badge/web3js-stackexchange-brightgreen
[stackexchange-url]: https://ethereum.stackexchange.com/questions/tagged/web3js
[docs]: https://tolar-clients.kwiki.io/docs/web3js
[repo]: https://github.com/dream-factory-code/web3.js
[repo-readme]: https://github.com/dream-factory-code/web3.js/blob/1.x/README.md
1 change: 0 additions & 1 deletion dist/web3.min.js

This file was deleted.

Loading