Skip to content

Commit

Permalink
Merge 8b399ed into 741cde3
Browse files Browse the repository at this point in the history
  • Loading branch information
osdio committed Feb 1, 2021
2 parents 741cde3 + 8b399ed commit 27bb9e6
Show file tree
Hide file tree
Showing 28 changed files with 12,418 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ coverage
.nyc_output/
package-lock.json
dist
docs
lib
static
lerna-debug.log
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ coverage
.nyc_output/
package-lock.json
lerna-debug.log
docs
1 change: 1 addition & 0 deletions docs/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14
76 changes: 76 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module.exports = {
theme: "cosmos",
title: "Vite.js",
base: process.env.VUEPRESS_BASE || '/',

locales: {
"/": {
lang: "en-US"
},
},

themeConfig: {
repo: "vitelabs/vite.js",
docsRepo: "vitelabs/vite.js",
docsDir: 'docs',
editLinks: true,
logo: {
src: '/logo.svg',
},
custom: true,
algolia: {
id: "BH4D9OD16A",
key: "ac317234e6a42074175369b2f42e9754",
index: "cosmos-sdk"
},
topbar: {
banner: false
},
sidebar: {
// Auto-sidebar, true by default
auto: true,
nav: [
{
title: "Resources",
children: [
{
title: "vite.org",
path: "https://vite.org"
}
]
}
]
},
footer: {
logo: "/logo.svg",
textLink: {
text: "vite.org",
url: "https://vite.org"
},
services: [
{
service: "twitter",
url: "https://twitter.com/vitelabs"
},
{
service: "medium",
url: "https://medium.com/vitelabs"
},
{
service: "telegram",
url: "https://t.me/vite_ann"
},
{
service: "discord",
url: "https://discord.com/invite/CsVY76q"
},
{
service: "github",
url: "https://github.com/vitelabs"
}
],
smallprint:
${new Date().getFullYear()} Vite Labs.`,
}
},
};
3 changes: 3 additions & 0 deletions docs/.vuepress/public/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/.vuepress/styles/index.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:root
--color-link #006fe9
--color-primary #006fe9
72 changes: 72 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
sidebarDepth: 4
title: Start
---

# Vite.js

## Installation

```bash
npm install @vite/vitejs --save
npm install @vite/vitejs-ws --save
```

Or

```bash
yarn add @vite/vitejs
yarn add @vite/vitejs-ws
```

## Module Import

ES6:

```javascript
import {
abi, error, keystore, utils, constant,
accountBlock, ViteAPI, wallet
} from '@vite/vitejs';

// must install http/ipc/ws packages separately if you need set up network connection
import ws from '@vite/vitejs-ws';
import http from '@vite/vitejs-http';
import ipc from '@vite/vitejs-ipc';
```

Common:

```javascript
const {
abi, error, keystore, utils, constant,
accountBlock, ViteAPI, wallet
} = require('@vite/vitejs');

// must install http/ipc/ws packages separately if you need set up network connection
const { WS_RPC } = require('@vite/vitejs-ws');
const { HTTP_RPC } = require('@vite/vitejs-http');
const { IPC_RPC } = require('@vite/vitejs-ipc');
```

## Quick Start

1. `npm install @vite/vitejs-ws`
2. `npm install @vite/vitejs`
3. Create file `test.js`
```javascript
const { WS_RPC } = require('@vite/vitejs-ws');
const { ViteAPI } = require('@vite/vitejs');

let WS_service = new WS_RPC("ws://example.com");
let provider = new ViteAPI(WS_service, () => {
console.log("Connected");
});

provider.request('ledger_getSnapshotChainHeight').then((result) => {
console.log(result);
}).catch((err) => {
console.warn(err);
});
```
4. `node test.js`

0 comments on commit 27bb9e6

Please sign in to comment.