solana-with-rpc-optimizations/web3.js/README.md

77 lines
2.5 KiB
Markdown
Raw Normal View History

2018-09-21 08:57:19 -07:00
[![Build status][travis-image]][travis-url]
[![codecov][codecov-image]][codecov-url]
[![esdoc][esdoc-image]][esdoc-url]
[![npm][npm-image]][npm-url]
2018-09-21 09:01:26 -07:00
[![david][david-deps-image]][david-deps-url]
[![david][david-dev-deps-image]][david-dev-deps-url]
2018-09-21 08:57:19 -07:00
[travis-image]: https://api.travis-ci.org/solana-labs/solana-web3.js.svg?branch=master
[travis-url]: https://travis-ci.org/solana-labs/solana-web3.js
[codecov-image]: https://codecov.io/gh/solana-labs/solana-web3.js/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/solana-labs/solana-web3.js
[esdoc-image]: https://solana-labs.github.io/solana-web3.js/badge.svg
[npm-image]: https://img.shields.io/npm/v/@solana/web3.js.svg?style=flat
[esdoc-url]: https://solana-labs.github.io/solana-web3.js/
[npm-url]: https://www.npmjs.com/package/@solana/web3.js
2018-09-21 09:01:26 -07:00
[david-deps-image]: https://david-dm.org/solana-labs/solana-web3.js.svg
[david-deps-url]: https://david-dm.org/solana-labs/solana-web3.js
[david-dev-deps-image]: https://david-dm.org/solana-labs/solana-web3.js/dev-status.svg
[david-dev-deps-url]: https://david-dm.org/solana-labs/solana-web3.js?type=dev
# Solana JavaScript API
2018-08-23 13:29:42 -07:00
This is the Solana Javascript API built on the Solana [JSON RPC API](https://github.com/solana-labs/solana/blob/master/doc/json-rpc.md)
2018-08-22 13:53:13 -07:00
[Latest API Documentation](https://solana-labs.github.io/solana-web3.js/)
2018-08-23 08:12:51 -07:00
## Installation
2018-08-22 20:06:29 -07:00
2018-08-23 08:12:51 -07:00
### Yarn
```
$ yarn add @solana/web3.js
```
### npm
2018-08-22 20:06:29 -07:00
```
$ npm install --save @solana/web3.js
```
2018-08-23 08:12:51 -07:00
### Browser bundle
```html
2018-09-13 19:55:56 -07:00
<script src="https://github.com/solana-labs/solana-web3.js/releases/download/v0.0.6/solanaWeb3.min.js"></script>
2018-08-23 08:12:51 -07:00
```
2018-08-22 20:06:29 -07:00
2018-08-23 08:12:51 -07:00
## Usage
2018-08-22 20:06:29 -07:00
2018-08-23 08:12:51 -07:00
### Javascript
```js
const solanaWeb3 = require('@solana/web3.js');
console.log(solanaWeb3);
```
2018-08-22 20:06:29 -07:00
2018-08-23 08:12:51 -07:00
### ES6
```js
import solanaWeb3 from '@solana/web3.js';
console.log(solanaWeb3);
```
### Browser bundle
```js
// `solanaWeb3` is provided in the global namespace by the `solanaWeb3.min.js` script bundle.
console.log(solanaWeb3);
```
2018-08-23 08:12:51 -07:00
## Examples
2018-08-24 09:07:15 -07:00
See the [examples/](https://github.com/solana-labs/solana-web3.js/tree/master/examples) directory for small snippets
2018-08-23 20:29:27 -07:00
A more complete web-based wallet example can be found at https://github.com/solana-labs/example-webwallet
2018-08-23 08:12:51 -07:00
## Releases
2018-08-22 20:06:29 -07:00
Releases are available on [Github](https://github.com/solana-labs/solana-web3.js/releases)
2018-08-24 09:07:15 -07:00
and [npmjs.com](https://www.npmjs.com/package/@solana/web3.js)
2018-08-23 16:39:43 -07:00
Each Github release features a tarball containing API documentation and a
minified version of the module suitable for direct use in a browser environment
(&lt;script&gt; tag)