Skip to content

Commit

Permalink
register and generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jawndiego committed Dec 6, 2023
1 parent 368842b commit 79ed9c9
Show file tree
Hide file tree
Showing 43 changed files with 636 additions and 240 deletions.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,23 @@ npm i @entropyxyz/entropy-js --save

### Usage

NOTICE
`endpoint ` defaults to 'ws://127.0.0.1:9944' if no value is provided.

```js
import Entropy from '@entropyxyz/entropy-js'

// initialize entropy

const seed = "SEED"
const endpoint = "endpoint"
const signer = await getWallet(charlieStashSeed)

const entropyAccount: EntropyAccount = {
sigRequestKey: signer,
programModKey: signer
}

const entropy = new Entropy({ seed, endpoint })
await entropy.ready
entropy = new Entropy({ account: entropyAccount})
await entropy.ready

```

Expand Down Expand Up @@ -78,7 +85,7 @@ Throws if the address being registered is already in use.

#### Example(s)
```js
const address = entropy.keys?.wallet.address
const address = entropy.account?.wallet.address
console.log({ address })

// Can do a pre-check to see if the address is registered
Expand Down Expand Up @@ -127,8 +134,8 @@ Creates an instance of ProgramManager.
| Name | Type |
| :------ | :------ |
| `«destructured»` | `Object` |
| › `signer` | [`Signer`](../interfaces/types.Signer.md) |
| › `substrate` | `ApiPromise` |
| › `signer` | [`Signer`](../interfaces/types.Signer.md) |
| › `substrate` | `ApiPromise` |
#### Returns
Expand Down Expand Up @@ -206,7 +213,7 @@ The response is then processed and converted to an ArrayBuffer before being retu
#### Example(s)
```js
// get program
const fetchedProgram: ArrayBuffer = await entropy.programs.get(entropy.keys?.wallet.address)
const fetchedProgram: ArrayBuffer = await entropy.programs.get(entropy.account?.wallet.address)
```
#### Defined in
Expand Down Expand Up @@ -386,4 +393,4 @@ Will throw an error if the transaction type does not have a corresponding adapte
#### Defined in
[index.ts:132](https://github.com/entropyxyz/entropy-js/blob/b4c1b9b/src/index.ts#L132)
[index.ts:132](https://github.com/entropyxyz/entropy-js/blob/b4c1b9b/src/index.ts#L132)
23 changes: 15 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@ npm i @entropyxyz/entropy-js --save

### Usage

NOTICE
`endpoint ` defaults to 'ws://127.0.0.1:9944' if no value is provided.

```js
import Entropy from '@entropyxyz/entropy-js'

// initialize entropy

const seed = "SEED"
const endpoint = "endpoint"
const signer = await getWallet(charlieStashSeed)

const entropyAccount: EntropyAccount = {
sigRequestKey: signer,
programModKey: signer
}

const entropy = new Entropy({ seed, endpoint })
await entropy.ready
entropy = new Entropy({ account: entropyAccount})
await entropy.ready

```

Expand Down Expand Up @@ -80,7 +87,7 @@ Throws if the address being registered is already in use.

#### Example(s)
```js
const address = entropy.keys?.wallet.address
const address = entropy.account?.wallet.address
console.log({ address })

// Can do a pre-check to see if the address is registered
Expand Down Expand Up @@ -127,8 +134,8 @@ Creates an instance of ProgramManager.
| Name | Type |
| :------ | :------ |
| `«destructured»` | `Object` |
| › `signer` | [`Signer`](../interfaces/types.Signer.md) |
| › `substrate` | `ApiPromise` |
| › `signer` | [`Signer`](../interfaces/types.Signer.md) |
| › `substrate` | `ApiPromise` |
#### Returns
Expand Down Expand Up @@ -206,7 +213,7 @@ The response is then processed and converted to an ArrayBuffer before being retu
#### Example(s)
```js
// get program
const fetchedProgram: ArrayBuffer = await entropy.programs.get(entropy.keys?.wallet.address)
const fetchedProgram: ArrayBuffer = await entropy.programs.get(entropy.account?.wallet.address)
```
#### Defined in
Expand Down
10 changes: 5 additions & 5 deletions docs/classes/extrinsic.default.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Initializes a new instance of the `ExtrinsicBaseClass`.

#### Defined in

[extrinsic/index.ts:30](https://github.com/entropyxyz/entropy-js/blob/a7aaa0c/src/extrinsic/index.ts#L30)
[extrinsic/index.ts:30](https://github.com/entropyxyz/entropy-js/blob/368842b/src/extrinsic/index.ts#L30)

## Properties

Expand All @@ -63,7 +63,7 @@ Initializes a new instance of the `ExtrinsicBaseClass`.

#### Defined in

[extrinsic/index.ts:21](https://github.com/entropyxyz/entropy-js/blob/a7aaa0c/src/extrinsic/index.ts#L21)
[extrinsic/index.ts:21](https://github.com/entropyxyz/entropy-js/blob/368842b/src/extrinsic/index.ts#L21)

___

Expand All @@ -73,7 +73,7 @@ ___

#### Defined in

[extrinsic/index.ts:20](https://github.com/entropyxyz/entropy-js/blob/a7aaa0c/src/extrinsic/index.ts#L20)
[extrinsic/index.ts:20](https://github.com/entropyxyz/entropy-js/blob/368842b/src/extrinsic/index.ts#L20)

## Methods

Expand Down Expand Up @@ -109,7 +109,7 @@ If the dry run fails or there's insufficient electricity (zaps).

#### Defined in

[extrinsic/index.ts:99](https://github.com/entropyxyz/entropy-js/blob/a7aaa0c/src/extrinsic/index.ts#L99)
[extrinsic/index.ts:99](https://github.com/entropyxyz/entropy-js/blob/368842b/src/extrinsic/index.ts#L99)

___

Expand Down Expand Up @@ -139,4 +139,4 @@ Will reject the promise if a dispatch error occurs or the filtered event is not

#### Defined in

[extrinsic/index.ts:45](https://github.com/entropyxyz/entropy-js/blob/a7aaa0c/src/extrinsic/index.ts#L45)
[extrinsic/index.ts:45](https://github.com/entropyxyz/entropy-js/blob/368842b/src/extrinsic/index.ts#L45)
Loading

0 comments on commit 79ed9c9

Please sign in to comment.