Giter Site home page Giter Site logo

criesofcarrots / solana-web3.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from solana-labs/solana-web3.js

0.0 2.0 0.0 5.95 MB

Solana Javascript API

Home Page: https://solana-labs.github.io/solana-web3.js

License: MIT License

JavaScript 97.92% Shell 1.14% CSS 0.94%

solana-web3.js's Introduction

Build status codecov esdoc
npm npm-downloads david david
semantic-release code-style-prettier

Solana JavaScript API

This is the Solana Javascript API built on the Solana JSON RPC API

Latest API Documentation

Installation

Yarn

$ yarn add @solana/web3.js

npm

$ npm install --save @solana/web3.js

Browser bundle

<script src="https://github.com/solana-labs/solana-web3.js/releases/download/v0.0.6/solanaWeb3.min.js"></script>

BPF program development

The Solana BPF SDK is located in the bpf-sdk/ subdirectory if you installed solana-web3.js from npmjs.com.

From a git clone, run npm run bpf-sdk:install to fetch the latest BPF SDK.

Additionally Rust must be installed to build Rust BPF programs such as examples/bpf-rust-noop/. See https://www.rust-lang.org/install.html for installation details.

Usage

Javascript

const solanaWeb3 = require('@solana/web3.js');
console.log(solanaWeb3);

ES6

import solanaWeb3 from '@solana/web3.js';
console.log(solanaWeb3);

Browser bundle

// `solanaWeb3` is provided in the global namespace by the `solanaWeb3.min.js` script bundle.
console.log(solanaWeb3);

Local Network

The solana-localnet program is provided to easily start a test Solana cluster locally on your machine. Docker must be installed. The JSON RPC endpoint of the local cluster is http://localhost:8899.

To start, first fetch the latest Docker image by running:

$ npx solana-localnet update

Then run the following command to start the cluster

$ npx solana-localnet up

While the cluster is running logs are available with:

$ npx solana-localnet logs -f

Stop the cluster with:

$ npx solana-localnet down

Flow

A Flow library definition is provided at module.flow.js. Add the following line under the [libs] section of your project's .flowconfig to activate it:

[libs]
node_modules/@solana/web3.js/module.flow.js

Examples

See the examples/ directory for small snippets.

Standalone examples:

Releases

Releases are available on Github and npmjs.com

Each Github release features a tarball containing API documentation and a minified version of the module suitable for direct use in a browser environment (<script> tag)

solana-web3.js's People

Contributors

mvines avatar dependabot-preview[bot] avatar dependabot-support avatar jstarry avatar criesofcarrots avatar jackcmay avatar sunnygleason avatar t-nelson avatar rob-solana avatar manuel-calavera avatar garious avatar parthdesai avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.