-
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 5c1c7d5
- Loading branch information
1 parent
32d96e0
commit ea23f1a
Showing
19 changed files
with
807 additions
and
135 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -11,5 +11,4 @@ custom_edit_url: null | |
|weight|string|| | ||
|proof|string|| | ||
|value|string|| | ||
|type|CensusProofType|| | ||
|
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,87 @@ | ||
--- | ||
custom_edit_url: null | ||
--- | ||
|
||
```ts | ||
class CensusService | ||
``` | ||
|
||
<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="#fetchCensusInfo">fetchCensusInfo</a><br/><a href="#fetchProof">fetchProof</a><br/><a href="#createCensus">createCensus</a><br/><a href="#fetchAccountToken">fetchAccountToken</a></div></div> | ||
</div> | ||
|
||
## constructor | ||
```ts | ||
new CensusService(params) | ||
``` | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Instantiate the census service. | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|params|Partial<CensusServiceParameters>|||The service parameters| | ||
|
||
## Methods | ||
|
||
### fetchCensusInfo {#fetchCensusInfo} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Fetches the information of a given census. | ||
|
||
**Returns**: Promise<{size: number, weight: bigint}> | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|censusId|string|||| | ||
|
||
### fetchProof {#fetchProof} | ||
|
||
<div> | ||
<span className="badge badge--success">async</span> | ||
</div> | ||
|
||
Fetches proof that an address is part of the specified census. | ||
|
||
**Returns**: Promise<[CensusProof](CensusProof)> | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|censusId|string|||Census we want to check the address against| | ||
|key|string|||The address to be found| | ||
|
||
### createCensus {#createCensus} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Publishes the given census. | ||
|
||
**Returns**: Promise<void> | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|census|[PlainCensus](PlainCensus) \| [WeightedCensus](WeightedCensus)|||The census to be published.| | ||
|
||
### fetchAccountToken {#fetchAccountToken} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Fetches the specific account token auth and sets it to the current instance. | ||
|
||
**Returns**: Promise<void> | ||
|
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,84 @@ | ||
--- | ||
custom_edit_url: null | ||
--- | ||
|
||
```ts | ||
class ChainService | ||
``` | ||
|
||
<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="#fetchChainData">fetchChainData</a><br/><a href="#fetchChainCosts">fetchChainCosts</a><br/><a href="#submitTx">submitTx</a><br/><a href="#txInfo">txInfo</a></div></div> | ||
</div> | ||
|
||
## constructor | ||
```ts | ||
new ChainService(params) | ||
``` | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Instantiate the chain service. | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|params|Partial<ChainServiceParameters>|||The service parameters| | ||
|
||
## Methods | ||
|
||
### fetchChainData {#fetchChainData} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Fetches blockchain information if needed. | ||
|
||
**Returns**: Promise<ChainData> | ||
|
||
### fetchChainCosts {#fetchChainCosts} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Fetches blockchain costs information if needed. | ||
|
||
**Returns**: Promise<ChainCosts> | ||
|
||
### submitTx {#submitTx} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Submits a transaction to the blockchain | ||
|
||
**Returns**: Promise<string> | ||
- The transaction hash | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|payload|string|||The transaction data payload| | ||
|
||
### txInfo {#txInfo} | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Fetches information about a transaction from the blockchain. | ||
|
||
**Returns**: Promise<ChainTx> | ||
- The chain transaction | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|txHash|string|||The transaction hash which we want to retrieve the info from| | ||
|
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,27 @@ | ||
--- | ||
custom_edit_url: null | ||
--- | ||
|
||
```ts | ||
class CspService | ||
``` | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
## constructor | ||
```ts | ||
new CspService(params) | ||
``` | ||
|
||
<div> | ||
|
||
</div> | ||
|
||
Instantiate the CSP service. | ||
|
||
|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| | ||
|:---:|:---:|:---:|:---:|:---:| | ||
|params|Partial<CspServiceParameters>|||The service parameters| | ||
|
Oops, something went wrong.