Skip to content

Commit

Permalink
docs(full-node): fix deprecated client import (#1363)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh authored Apr 21, 2022
1 parent 96f768e commit 4cb0d98
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 43 deletions.
4 changes: 2 additions & 2 deletions docs/node/02-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ A `Promise<?>` based design is used as async/await implementation are very matur
life to modern development.

```js
import {Client} from '@defichain/jellyfish'
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'

const client = new Client()
const client = new JsonRpcClient('http://foo:bar@localhost:8554')
const {blocks} = await client.mining.getMiningInfo()
```

Expand Down
6 changes: 3 additions & 3 deletions docs/node/CATEGORIES/01-blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/blockchain
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.blockchain.
const something = await client.blockchain.method()
Expand Down Expand Up @@ -391,4 +391,4 @@ interface ChainTxStats {
window_interval: number
txrate: number
}
```
```
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/02-mining.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/mining
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.mining.
const something = await client.mining.method()
Expand Down
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/03-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/net
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.net.
const something = await client.net.method()
Expand Down
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/04-rawtx.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/rawtx
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.rawtx.
const something = await client.rawtx.method()
Expand Down
7 changes: 3 additions & 4 deletions docs/node/CATEGORIES/05-wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ slug: /jellyfish/api/wallet
---

```js
import {Client} from '@defichain/jellyfish'

const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.wallet.
const something = await client.wallet.method()
Expand Down Expand Up @@ -396,4 +395,4 @@ For full information on the wallet, use [getWalletInfo](#getwalletinfo)
interface wallet {
listWallets (): Promise<string[]>
}
```
```
5 changes: 3 additions & 2 deletions docs/node/CATEGORIES/06-poolpair.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ slug: /jellyfish/api/poolpair
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.poolpair.
const something = await client.poolpair.method()
```
Expand Down
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/07-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/token
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.token.
const something = await client.token.method()
Expand Down
7 changes: 4 additions & 3 deletions docs/node/CATEGORIES/08-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ slug: /jellyfish/api/account
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.account.
const something = await client.account.method()
```
Expand Down Expand Up @@ -547,4 +548,4 @@ interface ListFutureInfo {
source: string // eg: '1.234@DUSD'
destination: string
}
```
```
6 changes: 3 additions & 3 deletions docs/node/CATEGORIES/09-oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/oracle
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.oracle.
const something = await client.oracle.method()
Expand Down Expand Up @@ -259,4 +259,4 @@ Get the next block that futures will execute and update on.
interface oracle {
getFutureSwapBlock (): Promise<number>
}
```
```
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/10-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/server
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.server.
const something = await client.server.method()
Expand Down
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/11-masternode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ slug: /jellyfish/api/masternode
---

```js
import {Client} from '@defichain/jellyfish'
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

const client = new Client()
// Using client.masternode.
const something = await client.masternode.method()
```
Expand Down
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/12-governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/governance
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.governance.
const something = await client.governance.method()
Expand Down
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/13-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/misc
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.misc.
const something = await client.misc.method()
Expand Down
6 changes: 3 additions & 3 deletions docs/node/CATEGORIES/14-spv.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/spv
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.spv.
const something = await client.spv.method()
Expand Down Expand Up @@ -362,4 +362,4 @@ Set last height on BTC chain, use for testing purpose.
interface spv {
setLastHeight (height: number): Promise<void>
}
```
```
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/15-icxorderbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/icxorderbook
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.icxorderbook.
const something = await client.icxorderbook.method()
Expand Down
4 changes: 2 additions & 2 deletions docs/node/CATEGORIES/16-loan.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/loan
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.loan.
const something = await client.loan.method()
Expand Down
6 changes: 3 additions & 3 deletions docs/node/CATEGORIES/17-vault.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ slug: /jellyfish/api/vault
---

```js
import {Client} from '@defichain/jellyfish'
const client = new Client()
import {JsonRpcClient} from '@defichain/jellyfish-api-jsonrpc'
const client = new JsonRpcClient('http://foo:bar@localhost:8554')

// Using client.vault.
const something = await client.vault.method()
Expand Down Expand Up @@ -350,4 +350,4 @@ interface vault {
export interface TokenPercentageSplit {
[token: string]: number // Token: split
}
```
```

0 comments on commit 4cb0d98

Please sign in to comment.