Skip to content

Commit

Permalink
Update vocdoni-sdk docs by commit 3a01e9a
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvelmer authored and arabot-1 committed Nov 15, 2023
1 parent 32d96e0 commit ed81993
Show file tree
Hide file tree
Showing 33 changed files with 2,465 additions and 229 deletions.
427 changes: 425 additions & 2 deletions docs/get-started/01-intro.md

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions docs/sdk/AccountService.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
custom_edit_url: null
---

```ts
class AccountService
```

<div>

</div>

<div className="container">
<div className="row mb-2"><div className="col col--12"><strong>Methods</strong></div></div>
<div className="row"><div className="col col--12"><a href="#fetchAccountInfo">fetchAccountInfo</a><br/><a href="#setInfo">setInfo</a></div></div>
</div>

## constructor
```ts
new AccountService(params)
```

<div>

</div>

Instantiate the election service.

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|params|Partial&lt;AccountServiceParameters&gt;|||The service parameters|

## Methods

### fetchAccountInfo {#fetchAccountInfo}

<div>
<span className="badge badge--success">async</span>
</div>

Fetches account information.

**Returns**: Promise&lt;[AccountData](AccountData)&gt;

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|address|string|||The account address to fetch the information|

### setInfo {#setInfo}

<div>

</div>

Updates an account with information

**Returns**: Promise&lt;string&gt;
- The transaction hash

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|tx|string|||The transaction for setting the account|
|metadata|string|||The account metadata|

73 changes: 73 additions & 0 deletions docs/sdk/AnonymousService.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
custom_edit_url: null
---

```ts
class AnonymousService
```

<div>

</div>

<div className="container">
<div className="row mb-2"><div className="col col--12"><strong>Methods</strong></div></div>
<div className="row"><div className="col col--12"><a href="#checkCircuitsHashes">checkCircuitsHashes</a><br/><a href="#fetchCircuits">fetchCircuits</a><br/><a href="#setCircuits">setCircuits</a></div></div>
</div>

## constructor
```ts
new AnonymousService(params)
```

<div>

</div>

Instantiate the anonymous service.

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|params|Partial&lt;AnonymousServiceParameters&gt;|||The service parameters|

## Methods

### checkCircuitsHashes {#checkCircuitsHashes}

<div>

</div>

Checks circuit hashes

**Returns**: ChainCircuits
- The checked circuit parameters

### fetchCircuits {#fetchCircuits}

<div>

</div>

Fetches circuits for anonymous voting

**Returns**: Promise&lt;ChainCircuits&gt;

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|circuits|Omit&lt;ChainCircuits, ('zKeyData'\|'vKeyData'\|'wasmData')&gt;|✔️||Additional options for custom circuits|

### setCircuits {#setCircuits}

<div>

</div>

Sets circuits for anonymous voting

**Returns**: Promise&lt;ChainCircuits&gt;

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|circuits|ChainCircuits|||Custom circuits|

28 changes: 28 additions & 0 deletions docs/sdk/AnonymousVote.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
custom_edit_url: null
---

```ts
class AnonymousVote
```

<div>

</div>

## constructor
```ts
new AnonymousVote(votes, password)
```

<div>

</div>

Constructs a csp vote

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|votes|Array&lt;number \| TSBigIntKeyword&gt;|||The list of votes values|
|password|string|✔️|"0"|The password of the anonymous vote|

30 changes: 30 additions & 0 deletions docs/sdk/ArchivedCensus.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
custom_edit_url: null
---

```ts
class ArchivedCensus
```

<div>

</div>

Represents an archived census

## constructor
```ts
new ArchivedCensus(censusId, censusURI)
```

<div>

</div>

Constructs an archived census

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|censusId|string|||The id of the census|
|censusURI|string|||The URI of the census|

29 changes: 29 additions & 0 deletions docs/sdk/ArchivedElection.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
custom_edit_url: null
---

```ts
class ArchivedElection
```

<div>

</div>

Represents a published election

## constructor
```ts
new ArchivedElection(params)
```

<div>

</div>

Constructs an archived election

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|params|IPublishedElectionParameters|||Election parameters|

25 changes: 20 additions & 5 deletions docs/sdk/Census3CensusAPI.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Census3CensusAPI

<div className="container">
<div className="row mb-2"><div className="col col--12"><strong>Methods</strong></div></div>
<div className="row"><div className="col col--12"><a href="#list">list</a><span className="badge badge--info margin-left--sm">static</span><br/><a href="#census">census</a><span className="badge badge--info margin-left--sm">static</span><br/><a href="#create">create</a><span className="badge badge--info margin-left--sm">static</span></div></div>
<div className="row"><div className="col col--12"><a href="#list">list</a><span className="badge badge--info margin-left--sm">static</span><br/><a href="#census">census</a><span className="badge badge--info margin-left--sm">static</span><br/><a href="#queue">queue</a><span className="badge badge--info margin-left--sm">static</span><br/><a href="#create">create</a><span className="badge badge--info margin-left--sm">static</span></div></div>
</div>

## constructor
Expand Down Expand Up @@ -57,20 +57,35 @@ Returns the information of the census
|url|string|||API endpoint URL|
|id|number|||The identifier of the census|

### queue {#queue}

<div>
<span className="badge badge--info">static</span>
</div>

Returns the information of the census queue

**Returns**: Promise&lt;ICensus3CensusQueueResponse&gt;

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|url|string|||API endpoint URL|
|id|string|||The identifier of the census queue|

### create {#create}

<div>
<span className="badge badge--info">static</span>
</div>

Requests the creation of a new census with the strategy provided for the blockNumber.
Requests the creation of a new census with the strategy provided.

**Returns**: Promise&lt;ICensus3CensusCreateResponse&gt;
- promised ICensus3CensusCreateResponse
**Returns**: Promise&lt;ICensus3QueueResponse&gt;
- The queue identifier

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|url|string|||API endpoint URL|
|strategyId|number|||The strategy identifier|
|blockNumber|number|✔️||The number of the block|
|anonymous|boolean|✔️|false|If the census has to be anonymous|

43 changes: 43 additions & 0 deletions docs/sdk/Census3ServiceAPI.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
custom_edit_url: null
---

```ts
class Census3ServiceAPI
```

<div>

</div>

<div className="container">
<div className="row mb-2"><div className="col col--12"><strong>Methods</strong></div></div>
<div className="row"><div className="col col--12"><a href="#info">info</a><span className="badge badge--info margin-left--sm">static</span></div></div>
</div>

## constructor
```ts
new Census3ServiceAPI()
```

<div>

</div>

Cannot be constructed.

## Methods
### info {#info}

<div>
<span className="badge badge--info">static</span>
</div>

Fetches supported chains from the service

**Returns**: Promise&lt;ICensus3ServiceInfoResponse&gt;

|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION|
|:---:|:---:|:---:|:---:|:---:|
|url|string|||API endpoint URL|

Loading

0 comments on commit ed81993

Please sign in to comment.