-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update vocdoni-sdk docs by commit ffae80b
- Loading branch information
1 parent
32d96e0
commit 1f23f08
Showing
33 changed files
with
2,457 additions
and
229 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<AccountServiceParameters>|||The service parameters| | ||
|
||
## Methods | ||
|
||
### fetchAccountInfo {#fetchAccountInfo} | ||
|
||
<div> | ||
<span className="badge badge--success">async</span> | ||
</div> | ||
|
||
Fetches account information. | ||
|
||
**Returns**: Promise<[AccountData](AccountData)> | ||
|
||
|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<string> | ||
- The transaction hash | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|tx|string|||The transaction for setting the account| | ||
|metadata|string|||The account metadata| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<AnonymousServiceParameters>|||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<ChainCircuits> | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|circuits|Omit<ChainCircuits, ('zKeyData'\|'vKeyData'\|'wasmData')>|✔️||Additional options for custom circuits| | ||
|
||
### setCircuits {#setCircuits} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Sets circuits for anonymous voting | ||
|
||
**Returns**: Promise<ChainCircuits> | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|circuits|ChainCircuits|||Custom circuits| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<number \| TSBigIntKeyword>|||The list of votes values| | ||
|password|string|✔️|"0"|The password of the anonymous vote| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<ICensus3ServiceInfoResponse> | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|url|string|||API endpoint URL| | ||
|
Oops, something went wrong.