-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Inline comments for the contract * Create rust doc for public methods
- Loading branch information
1 parent
4590d87
commit ce731da
Showing
3 changed files
with
127 additions
and
0 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,39 @@ | ||
# Documentation | ||
|
||
This NEAR contract for the attestation registry contains several components to allow users to submit attestations as well as publish package manifests. | ||
|
||
|
||
## Public Methods | ||
|
||
Be sure to check out the inline documentation for detailed descriptions of parameters. One thing to note is that keys for attestations are generated by hashing both the package name and author. | ||
|
||
``create_manifest`` | ||
|
||
This method allows an author to publish a package manifest under a specific package name. The contract uses the lazy-loaded storage available on NEAR. It supports the ability for both predecessor accounts as well as signers to be the key in which others can retrieve manifests. | ||
Projects such as `bos-workspace` can then use their namespace accounts to forward transactions on behalf of users. | ||
|
||
``get_latest_manifest`` | ||
|
||
Retrieves the last manifest that was published to the registry for a particular package. Transaction will revert if the conditions for retrieval are not satisfied. | ||
|
||
``get_manifest`` | ||
|
||
If a user knows the version of the package manifest they are looking for they can retrieve it from the registry. Given the fact a version may exist at one point in time we return a string "None" when not found in cases in which other contracts may not want to revert when accessing | ||
documents stored in the registry. | ||
|
||
``update_manifest`` | ||
|
||
An author may update the cid for an existing manifest in the registry. This function does revert if the manifest was not published by a signer. Furthermore, it will revert if the manifest does not exist in the registry prior to updating. | ||
|
||
``create_attestation`` | ||
|
||
When a package manifest has been published for a package name and given author NEAR account ID, another signer may create an attestation object that contains a cid representing a claim. | ||
|
||
``get_attestations`` | ||
|
||
You may then retreive all of the attestations from a particular user if you know the package name and package author the claim is being generated against. This function reverts when claims are not found for a given namespace. | ||
|
||
``get_attestation`` | ||
|
||
If you know the order of attestations submitted to the registry, this method allows you to only retrieve that particular claim. It will revert if the parameters provided are not found. | ||
|
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,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="generator" content="rustdoc"> | ||
<title>Documentation</title> | ||
|
||
|
||
|
||
</head> | ||
<body class="rustdoc"> | ||
<!--[if lte IE 8]> | ||
<div class="warning"> | ||
This old browser is unsupported and will most likely display funky | ||
things. | ||
</div> | ||
<![endif]--> | ||
|
||
|
||
<h1 class="title">Documentation</h1> | ||
<nav id="TOC"><ul> | ||
<li><a href="#public-methods">0.1 Public Methods</a><ul></ul></li></ul></nav><p>This NEAR contract for the attestation registry contains several components to allow users to submit attestations as well as publish package manifests.</p> | ||
<h2 id="public-methods"><a href="#public-methods">0.1 Public Methods</a></h2> | ||
<p>Be sure to check out the inline documentation for detailed descriptions of parameters. One thing to note is that keys for attestations are generated by hashing both the package name and author.</p> | ||
<p><code>create_manifest</code></p> | ||
<p>This method allows an author to publish a package manifest under a specific package name. The contract uses the lazy-loaded storage available on NEAR. It supports the ability for both predecessor accounts as well as signers to be the key in which others can retrieve manifests. | ||
Projects such as <code>bos-workspace</code> can then use their namespace accounts to forward transactions on behalf of users.</p> | ||
<p><code>get_latest_manifest</code></p> | ||
<p>Retrieves the last manifest that was published to the registry for a particular package. Transaction will revert if the conditions for retrieval are not satisfied.</p> | ||
<p><code>get_manifest</code></p> | ||
<p>If a user knows the version of the package manifest they are looking for they can retrieve it from the registry. Given the fact a version may exist at one point in time we return a string “None” when not found in cases in which other contracts may not want to revert when accessing | ||
documents stored in the registry.</p> | ||
<p><code>update_manifest</code></p> | ||
<p>An author may update the cid for an existing manifest in the registry. This function does revert if the manifest was not published by a signer. Furthermore, it will revert if the manifest does not exist in the registry prior to updating.</p> | ||
<p><code>create_attestation</code></p> | ||
<p>When a package manifest has been published for a package name and given author NEAR account ID, another signer may create an attestation object that contains a cid representing a claim.</p> | ||
<p><code>get_attestations</code></p> | ||
<p>You may then retreive all of the attestations from a particular user if you know the package name and package author the claim is being generated against. This function reverts when claims are not found for a given namespace.</p> | ||
<p><code>get_attestation</code></p> | ||
<p>If you know the order of attestations submitted to the registry, this method allows you to only retrieve that particular claim. It will revert if the parameters provided are not found.</p> | ||
|
||
|
||
</body> | ||
</html> |
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