@corpus-core/colibri-stateless 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,15 +20,21 @@ npm install @corpus-core/colibri-stateless
|
|
|
20
20
|
```js
|
|
21
21
|
import Colibri from "@corpus-core/colibri-stateless";
|
|
22
22
|
|
|
23
|
-
const client = new Colibri();
|
|
24
23
|
|
|
25
24
|
async function main() {
|
|
26
25
|
const method = "eth_getTransactionByHash";
|
|
27
26
|
const args = ['0x2af8e0202a3d4887781b4da03e6238f49f3a176835bc8c98525768d43af4aa24'];
|
|
28
27
|
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
const
|
|
29
|
+
// Initialize the client with the default configuration and RPCs
|
|
30
|
+
const client = new Colibri();
|
|
31
|
+
|
|
32
|
+
// Create a proof for the given method and arguments as UInt8Array
|
|
33
|
+
const proof = await client.createProof(method, args);
|
|
34
|
+
|
|
35
|
+
// Verify the proof against requested method and arguments
|
|
36
|
+
const result = await client.verifyProof(method, args, proof);
|
|
37
|
+
|
|
32
38
|
console.log(result);
|
|
33
39
|
}
|
|
34
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corpus-core/colibri-stateless",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Colibri is a stateless and trustless ethereum client, which is optimized for the mobile apps or embedded devices, because it does not hols the state, but verifies on demand.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {},
|