Coder Social home page Coder Social logo

cord.js's Introduction

CORD.js

CORD.js is a JavaScript library that provides a collection of classes and methods to interact with the Cord network.

Table of Contents


Building the SDK

To build the SDK and see changes, follow these steps:

  1. Clone this repository to your local machine:

    git clone <repository_url>
    cd <repository_directory>
    
  2. Install dependencies using yarn:

    yarn
    
  3. Build the SDK:

    yarn build
    

Experimenting with SDK Methods

Demo Methods

Once the SDK is built, you can experiment with the provided methods.

Statement Method:

The demo-statement method allows you to interact with statement-related functionalities.

To run the statement demo, execute the following command:

yarn demo-statement

Network Score Method:

The demo-network-score method demonstrates methods related to network scores.

To run the network score demo, execute the following command:

yarn demo-network-score

Asset Method:

The demo-asset method showcases methods related to assets.

To run the asset demo, execute the following command:

yarn demo-asset

The output of each demo script will demonstrate the functionality of the corresponding method. For a detailed structure of the demo scripts, refer to the source code.

Consuming the SDK in Your Project

To use the SDK in your project, follow these steps:

  1. Navigate to your project directory.

  2. Install the SDK using npm or yarn:

npm install @cord.network/sdk

Or with yarn:

yarn add @cord.network/sdk

Once installed, you can import and utilize the SDK in your project as needed.

cord.js's People

Contributors

smohan-dw avatar amarts avatar adi-a11y avatar vatsa287 avatar niranjanap avatar vikastc avatar kartikaysaxena avatar hardiksharma11 avatar masterismail avatar prasanthyt avatar sharjidh avatar gamemaker1 avatar

Stargazers

Muskan Nain avatar ASHWIN RAJ CK avatar Divesh S avatar Trae Yelovich avatar Abhinav Pandey avatar Amaan Bhati avatar Jerom avatar  avatar  avatar Harsh Raj avatar Niranjan Anandkumar avatar  avatar guna sekhar babu avatar  avatar  avatar Tejas R avatar  avatar Adarsh Singh avatar  avatar  avatar Atharva avatar Prasad Mutnale avatar  avatar K M RIJAS MUHAMMED avatar Sujith Baruve avatar sankarshan avatar  avatar salman vaipees avatar abhinand avatar prashantrm avatar Rohit Bhandari avatar rithwik krishna avatar Rahul Chandra avatar  avatar Ujjwal Sharma avatar Arpan Abhishek avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cord.js's Issues

[C4GT] Demo for Chainspace `archive`

Description

Create a demo script to showcase the Chainspace archive method.

Goals

  • Demonstrate the Chainspace archive method.

Expected Outcome

The event should be visible on explorer (apps.cord.network).

Acceptance Criteria

N/A

Implementation Details

In the demo/src directory, create a file named demo-chainspace.ts if it doesn't already exist, and use this file to write the demo code.

Mockups / Wireframes

N/A


Product Name

CORD.js

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

TypeScript

Mentor(s)

@amarts @adi-a11y @vatsa287

Complexity

Medium

Category

Demo

Support Self-attested content in Verifiable Presentation

Description

Verifiable Presentation is the way one or multiple Verifiable Credentials would be submitted as a response to the request to submit information. (think of an application form). In many cases, not all the fields asked in the application may be filled by the existing VCs, where it may be OK to have a self attested (or self-signed) content added, which should be properly understood and decoded during verification.

Goals

  • Allow usage of trusted application forms using VCs.
  • Support self-attested fields while filling the form.

Expected Outcome

We should be able to demonstrate a successful VP as a response to application form.

Acceptance Criteria

NA

Implementation Details

NA

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

VC, SDK,

Tech Skills Needed

Typescript

Mentor(s)

@amarts | @NiranjanAP

Complexity

[High]]

Category

[PoC]

Sub Category

[API], [Backend], [Technical Debt]

Allow building presentation with multiple VCs

The document.createPresentation() takes the fields as string array, instead it should take it as object and option to tell which VC it wants the fields from.
Sample

{
  “fields”: [ 
      { “k”: “email”, “v”: [ “did1”, “did2” ] }, 
      { “k”: “name”, “v”: [ “did1”, “did2”, “aadhaarDid”, “panDid” ] }, 
      { “k”: “company”, “v”: [ “self” ] },
      { “k”: “event”, “v”: [] }
] 
}

[C4GT] Button for likes

Description

When a data is represented digitally, it can be of complex type, not just a basic 'string', number, date, boolean format. If there is a complex data type, it can then be represented as an 'object' in schema, which can be handled during parsing of the data during IDocument (Verifiable document) format.

Goals

  • Allow usage of a complex type

Expected Outcome

We should be able to store a complex type.

Acceptance Criteria

NA

Implementation Details

NA

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

Rust

Mentor(s)

@amarts

Complexity

Pick one of [High]/[Medium]/[Low]

Category

Pick one or more of [CI/CD], [Integrations], [Performance Improvement], [Security], [UI/UX/Design], [Bug], [Feature], [Documentation], [Deployment], [Test], [PoC]

Sub Category

Pick one or more of [API], [Database], [Analytics], [Refactoring], [Data Science], [Machine Learning], [Accessibility], [Internationalization], [Localization], [Frontend], [Backend], [Mobile], [SEO], [Configuration], [Deprecation], [Breaking Change], [Maintenance], [Support], [Question], [Technical Debt], [Beginner friendly], [Research], [Reproducible], [Needs Reproduction]

[C4GT] make 'object' as a valid 'type' in schema fields

What is this enhancement about?

When a data is represented digitally, it can be of complex type, not just a basic 'string', number, date, boolean format. If there is a complex data type, it can then be represented as an 'object' in schema, which can be handled during parsing of the data during IDocument (Verifiable document) format.

How to test it?

Add a schema with 'object' type of field, for example below sample:

{ .... 
   "properties": {
      "address": {
          "type": "object",
           "properties": {
              "street": ...,
              "pincode": ...,
              "state": ...,
              "district": ..., 
          }
       }
   }
  ...
}

and then use the data similarly.

Things to look out for

  • How will contentHashes part of IDocument (or VC proof) be structured if its object?

[C4GT] Asset: Separate preparation of creation of Asset from dispatch

Description

Separate preparation of Asset Entry and dispatch of extrinsic to chain. This would help when bulk transaction takes place so we just prepare all the required extrinsics and then execute these transaction in batches by dumping them into a promise using
a batch sign & submit utility ex, authorizeBatch which can take array of extrinsics, instead of just one.

Goals

  • Creation of new export function named prepareCreateExtrinsic(), which will contain creation of asset entry and Did.AuthorizeTx().
  • Integration of above method into existing dispatchCreateToChain()

Implementation Details

Developers/Contributors can refer to example PRs: #188, #182


Product Name

CORD.JS

Organization Name

Dhiway

Domain

Blockchain, SDK Development, API

Tech Skills Needed

Typescript

Mentor(s)

@amarts @vatsa287

Complexity

[Low]

Category

[Performance Improvement], [Feature]

Sub Category

[API], [Refactoring], [Backend], [Beginner friendly]

[C4GT] Add SDK support for chainspace `removeDelegate`

Description

This function will remove an existing delegate from a space, given the space ID and the delegate's authorization ID. It checks that verifies that the caller has the authority to remove a delegate.

Goals

  • Add methods in the chainspace module to support the removeDelegate feature.

Expected Outcome

We should be able to remove a delegate

Acceptance Criteria

  • Methods are in the correct files.
  • Build succeeds.
  • Methods work as expected.
  • Code is well-commented.

Implementation Details

Any chain call should be made in the ChainSpace.chain.ts file, and the preparation of extrinsic should be done in the ChainSpace.ts file.

Mockups / Wireframes

N/A


Product Name

CORD.js

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

TypeScript

Mentor(s)

@amarts, @adi-a11y, @vatsa287

Complexity

Medium

Category

Feature

Update README

Description

Make sure README reflects what is in the project, and using README, one is able to complete a demo run. Also it should have links to documentation for further study.

Goals

  • Run through the README file and verify the if it is missing something

Expected Outcome

  • README file is accurate, anyone following it should not have any further questions, in setting up the dev environment and be able to run the demo script

Acceptance Criteria

Following the instructions on the README file, one should be able to set up the dev environment and be able to run the demo script

Implementation Details

NA

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

Rust build tool chain

Mentor(s)

@amarts @NiranjanAP

Complexity

Low

Category

Documentation

Sub Category

Beginner friendly

[C4GT] Add SDK support for chainspace `restore`

Description

This function unarchives a space based on the provided space ID. It checks that the space exists, is currently archived, and is approved. It also verifies that the caller has the authority to restore the space, as indicated by the provided authorization ID.

Goals

  • Add methods in the chainspace module to support the restore feature.

Expected Outcome

We should be able to restore a chainspace.

Acceptance Criteria

  • Methods are in the correct files.
  • Build succeeds.
  • Methods work as expected.
  • Code is well-commented.

Implementation Details

Any chain call should be made in the ChainSpace.chain.ts file, and the preparation of extrinsic should be done in the ChainSpace.ts file.

Mockups / Wireframes

NA


Product Name

CORD.js

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

TypeScript

Mentor(s)

@amarts @adi-a11y @vatsa287

Complexity

Medium

Category

Feature

Provide 'update' method for stream contents

Description

Today, we have stream.create() and stream.revoke() methods added in cord.js SDK. We need to build proper interfaces and methods for stream.update() extrinsic, so we can get started with full fledged integration with current studio and any other tools like sunbird RC.

Goals

  • Build interfaces and methods for stream.update()
  • Integrate the new interface in demo.ts

Expected Outcome

new module updateStream creation and integration with demo.ts script

Acceptance Criteria

demo.ts should continue to work with the changes

Implementation Details

  • create a new file demo/src/utils/updateStream.ts
  • make call to api.tx.stream.update()
  • import updateStream.ts into demo.ts

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

Rust

Mentor(s)

@amarts @NiranjanAP

Complexity

Low

Category

Feature

Sub Category

Refactoring

Yarn complains about missing NPM token

Usage Error: Environment variable not found (NPM_TOKEN) in /Users/smohan/devel/smohan/ondc/cord.js/.yarnrc.yml (in /Users/smohan/devel/smohan/ondc/cord.js/.yarnrc.yml)

[DMP 2024]: Create a core modules of cord.js sdk in Golang

Description

cord.js is an SDK to connect to CORD. We have a requirement to write the same SDK in Golang.
As part of this we have to first create the core SDK modules that include the DID and Chainspace. Scope of this issue it to create an SDK in Golang along with any dependencies.

Goals

  • Basic framework of the SDK established, able to connect to CORD
  • Replication of all packages present currently in CORD.js ex: statement, asset, network-score etc.
  • Demo scripts for all implemented packages currently present in CORD.js, similar to statement demo-script -> https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts

Expected Outcome

We should have a functioning sdk written in Golang that connects to CORD and is able to make calls to CORD

Acceptance Criteria

Fully functioning SDK written in Golang with all the available methods/functions implemented
A working demo script similar to https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts
All the unit test cases implemented

Implementation Details

Refer cord.js repo for reference SDK written in typescript, this needs to be replicated in Golang
Refer to the documentation https://docs.cord.network/cordjs/integratecord/ for the detailed explanation on the working of demo script https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts
Note: There will be some dependency modules before these two modules can work

Mockups/Wireframes

NA

Product Name

cord sdk in Golang

Organisation Name

Dhiway

Domain

Open Source Library

Tech Skills Needed

Go, TypeScript

Mentors

@vatsa287 @adi-a11y @amarts @NiranjanAP

Category

Other

Make object as a valid type in schema fields

Description

When a data is represented digitally, it can be of complex type, not just a basic 'string', number, date, boolean format. If there is a complex data type, it can then be represented as an 'object' in schema, which can be handled during parsing of the data during IDocument (Verifiable document) format.

Goals

  • Allow usage of a complex type

Expected Outcome

We should be able to store a complex type.

Acceptance Criteria

NA

Implementation Details

NA

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

Rust

Mentor(s)

@amarts

Complexity

Medium

Category

Feature

Sub Category

Technical Debt

'credential': provide better variable and method names

In the VC ecosystem, 'Credential' is used synonyms with Verifiable Credential. But in our SDK, credential is used as synonym with a 'stream' with signature, which is source for a VC (or any other format if we need to build output conversion libraries), but not VC by itself.

This should be properly captured in SDK's codebase, and documentation. We can go ahead with 'document' as the variable name in the codebase and documentation for this. (Please suggest better name too).

[C4GT] ChainSpace: Separate preparation of UpdateTxCapacityToChain from dispatch

Description

Separate UpdateTxCapacityToChain preparation and dispatch of extrinsic to chain. This would help when bulk transaction takes place so we just prepare all the required extrinsics and then execute these transaction in batches by dumping them into a promise using
a batch sign & submit utility ex, authorizeBatch which can take array of extrinsics, instead of just one.

Goals

  • Creation of new export function named prepareUpdateTxCapacityExtrinsic(), which will contain updateTransactionCapacitySub() and Did.AuthorizeTx().
  • Integration of above method into existing dispatchUpdateTxCapacityToChain()

Implementation Details

Developers/Contributors can refer to example PRs: #188, #182


Product Name

CORD.JS

Organization Name

Dhiway

Domain

Blockchain, SDK Development, API

Tech Skills Needed

Typescript

Mentor(s)

@amarts @vatsa287

Complexity

[Low]

Category

[Performance Improvement], [Feature]

Sub Category

[API], [Refactoring], [Backend], [Beginner friendly]

[C4GT] Support Array fields in selective disclosure

Description

A content in a VC (Verifiable Credential) can be an array (like string, number, boolean or object). We are adding support for object type through #109 similarly we need to add support to individual array elements to be available separately in content-hash.

Goals

  • Allow usage of a array type in a Verifiable Credential's schema and thus VC content.

Expected Outcome

We should be able to issue and verify a VC with array element.

Acceptance Criteria

NA

Implementation Details

NA

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

VC, SDK,

Tech Skills Needed

TypeScript

Mentor(s)

@amarts / @NiranjanAP

Complexity

[Low]

Category

[Feature]

Sub Category

[API], [Technical Debt], [Beginner friendly], [Research]

Add Support for DID Creation and Retrieval in SDK

Issue:
All write operations in CORD are performed through DID calls. However, the createDid method, which is essential for creating DIDs, is not included in the SDK. This presents a limitation as developers are unable to utilize the SDK for DID creation despite the pivotal role DIDs play within the system.

Typically, developers generate a mnemonic and a corresponding DID, storing only the mnemonic for future reference. It is imperative for the SDK to include functionality for retrieving the DID using the mnemonic directly. Presently, developers must manually create a custom function to extract the DID from the blockchain by providing the mnemonic as input.

Proposal:
To enhance the functionality and usability of the SDK, it's crucial to add support for both DID creation and retrieval. This would streamline the development process and align with the common practice where developers generate a mnemonic and DID, storing only the mnemonic while relying on the SDK to handle DID retrieval.

Build errors encountered after augment-api update

➤ YN0000: src/interfaces/augment-types.ts(328,5): error TS2300: Duplicate identifier 'Data'.
➤ YN0000: src/interfaces/augment-types.ts(329,5): error TS2300: Duplicate identifier 'Data'.
➤ YN0000: src/interfaces/extraDefs/types.ts(21,34): error TS2304: Cannot find name 'PalletDidServiceEndpointsDidEndpoint'.
➤ YN0000: src/interfaces/extraDefs/types.ts(21,34): error TS4033: Property 'serviceEndpoints' of exported interface has or is using private name 'PalletDidServiceEndpointsDidEndpoint'.
➤ YN0000: src/interfaces/extraDefs/types.ts(22,21): error TS2304: Cannot find name 'PalletDidDidDetails'.
➤ YN0000: src/interfaces/extraDefs/types.ts(22,21): error TS4033: Property 'details' of exported interface has or is using private name 'PalletDidDidDetails'.

reference to commit - c08c2d5

Improve SDK Behavior for Duplicate Statement Anchoring

Description:
When attempting to anchor a statement that is already present on the chain using the SDK, the current behaviour is confusing. The SDK returns the identifier without errors and no events are observed on the chain. It becomes perplexing because, while the terminal indicates that the dispatch call has been executed, there are no corresponding events observable on the chain. Consequently, one is left pondering why no error is displayed or why the event is absent on the chain, despite the SDK indicating successful execution without errors.

Proposed Fix:
If the statement is already anchored on the chain, the SDK should throw an error indicating "The statement already exists" and should also return the identifier for reference.

`api.tx.utility.batchAll()` error occurrence

Issue:
Encountering an error "The DID operation nonce does not match the current DID nonce + 1" when using api.tx.utility.batchAll().

Requirement:
For bulk uploads or revocations of records in the studio.

[DMP 2024]: Create the core modules of cord.js sdk in Python

Description

cord.js is an SDK to connect to CORD. We have a requirement to write the same SDK in Python.
As part of this we have to first create the core SDK modules that include the DID and Chainspace. Scope of this issue it to create an SDK in Python along with any dependencies.

Goals

  • Basic framework of the SDK established, able to connect to CORD
  • Replication of all packages present currently in CORD.js ex: statement, asset, network-score etc.
  • Demo scripts for all implemented packages currently present in CORD.js, similar to statement demo-script -> https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts

Expected Outcome

We should have a functioning SDK written in Python that connects to CORD and is able to make calls to CORD

Acceptance Criteria

Fully functioning SDK written in Python with all the available methods/functions implemented
A working demo script https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts
All the unit test cases implemented

Implementation Details

Refer cord.js repo for reference SDK written in typescript, this needs to be replicated in Python
Refer to the documentation https://docs.cord.network/cordjs/integratecord/ for the detailed explanation on the working of demo script https://github.com/dhiway/cord.js/blob/develop/demo/src/func-test.ts
Note: There will be some dependency modules before these two modules can work

Mockups/Wireframes

NA

Product Name

cord sdk in Python

Organisation Name

Dhiway

Domain

Open Source Library

Tech Skills Needed

Python, TypeScript

Mentor(s)

@adi-a11y @amarts @NiranjanAP

Category

Other

Move `signAndSubmitTx` out of the function `dispatchRegisterToChain` & `dispatchRevokeToChain`

Issue:
The authorizeBatch() function currently accepts an array of Extrinsic objects as its argument. However, when utilizing dispatchRegisterToChain(), it submits a single transaction directly to the chain.

Requirement:
For bulk uploads or revocations of records in the studio.

Solution:
To address this, consider removing the signAndSubmitTx() function from within dispatchRegisterToChain() and instead have it return only the extrinsic. The same has to be done for dispatchRevokeToChain()

Add Support for DID Creation and Retrieval in SDK

Issue:
All write operations in CORD are performed through DID calls. However, the createDid method, which is essential for creating DIDs, is not included in the SDK. This presents a limitation as developers are unable to utilize the SDK for DID creation despite the pivotal role DIDs play within the system.

Typically, developers generate a mnemonic and a corresponding DID, storing only the mnemonic for future reference. It is imperative for the SDK to include functionality for retrieving the DID using the mnemonic directly. Presently, developers must manually create a custom function to extract the DID from the blockchain by providing the mnemonic as input.

Proposal:
To enhance the functionality and usability of the SDK, it's crucial to add support for both DID creation and retrieval. This would streamline the development process and align with the common practice where developers generate a mnemonic and DID, storing only the mnemonic while relying on the SDK to handle DID retrieval.

Expected Behavior:

  1. Addition of createDid method within the SDK, enabling developers to programmatically generate DIDs.
  2. Implementation of fetchDidFromMnemonic method to retrieve DIDs using mnemonics, simplifying the process for developers.

[C4GT] provide 'update' method for stream contents

What is this enhancement about?

Today, we have stream.create() and stream.revoke() methods added in cord.js SDK. We need to build proper interfaces and methods for stream.update() extrinsic, so we can get started with full fledged integration with current studio and any other tools like sunbird RC.

How to test?

Enhance yarn demo to perform stream.update, and make sure we see stream.updated event on chain using explorer UI.

What are the things to consider?

  • content module will have to get a proper 'update()' method too, which should be passed for stream module.

[C4GT] ChainSpace: Separate preparation of create subspace extrinsic from chain dispatch

Description

Separate chain-space creation preparation and dispatch of extrinsic to chain. This would help when bulk transaction takes place so we just prepare all the required extrinsics and then execute these transaction in batches by dumping them into a promise using
a batch sign & submit utility ex, authorizeBatch which can take array of extrinsics, instead of just one.

Goals

  • Creation of new export function named prepareCreateSubSpaceExtrinsic()
  • Integration of above method into existing dispatchSubspaceCreateToChain()

Implementation Details

Developers/Contributors can refer to example PRs: #188, #182


Product Name

CORD.JS

Organization Name

Dhiway

Domain

Blockchain, SDK Development, API

Tech Skills Needed

Typescript

Mentor(s)

@amarts @NiranjanAP @vatsa287 @adi-a11y

Complexity

[Low]

Category

[Performance Improvement], [Feature]

Sub Category

[API], [Refactoring], [Backend], [Beginner friendly]

`yarn build:docs` failing

My current setup

node -v && yarn --version
v18.15.0
3.3.1

Branch dev-0.8.0

The error message I'm receiving

yarn build:docs
Warning: You are running with an unsupported TypeScript version! This may work, or it might break. TypeDoc supports 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7
Error: packages/messaging/src/Message.ts:214:57 - error TS2554: Expected 0-1 arguments, but got 2.

214     throw new SDKErrors.DecodingMessageError(undefined, {
                                                            ~
215       cause: cause as Error,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216     })
    ~~~~~

Error: packages/modules/src/content/Content.ts:193:7 - error TS2554: Expected 0-1 arguments, but got 2.

193       { cause: errors }
          ~~~~~~~~~~~~~~~~~

Error: packages/modules/src/schema/Schema.chain.ts:58:7 - error TS2554: Expected 0-1 arguments, but got 2.

58       { cause }
         ~~~~~~~~~

Error: packages/modules/src/schema/Schema.ts:114:5 - error TS2554: Expected 0-1 arguments, but got 2.

114     { cause: errors }
        ~~~~~~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:26:25 - error TS2304: Cannot find name 'ErrorOptions'.

26   constructor(options?: ErrorOptions) {
                           ~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:29:7 - error TS2554: Expected 0-1 arguments, but got 2.

29       options
         ~~~~~~~

Error: packages/utils/src/SDKErrors.ts:138:38 - error TS2304: Cannot find name 'ErrorOptions'.

138   constructor(did: string, options?: ErrorOptions) {
                                         ~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:139:44 - error TS2554: Expected 0-1 arguments, but got 2.

139     super(`Not a valid CORD DID "${did}"`, options)
                                               ~~~~~~~

Error: packages/utils/src/SDKErrors.ts:200:25 - error TS2304: Cannot find name 'ErrorOptions'.

200   constructor(options?: ErrorOptions) {
                            ~~~~~~~~~~~~

Error: packages/utils/src/SDKErrors.ts:203:7 - error TS2554: Expected 0-1 arguments, but got 2.

203       options
          ~~~~~~~

[C4GT] Asset: Separate preparation of creation of VC Asset from dispatch

Description

Separate preparation of VC Asset Entry and dispatch of extrinsic to chain. This would help when bulk transaction takes place so we just prepare all the required extrinsics and then execute these transaction in batches by dumping them into a promise using
a batch sign & submit utility ex, authorizeBatch which can take array of extrinsics, instead of just one.

Goals

  • Creation of new export function named prepareCreateVcExtrinsic(), which will contain creation of asset entry and Did.AuthorizeTx().
  • Integration of above method into existing dispatchCreateVcToChain()

Implementation Details

Developers/Contributors can refer to example PRs: #188, #182


Product Name

CORD.JS

Organization Name

Dhiway

Domain

Blockchain, SDK Development, API

Tech Skills Needed

Typescript

Mentor(s)

@amarts @vatsa287

Complexity

[Low]

Category

[Performance Improvement], [Feature]

Sub Category

[API], [Refactoring], [Backend], [Beginner friendly]

NOTE:

This is a good-first-issue meaning it is open for new contributors. If you have already worked on similar issues, please avoid getting assigned on these & start working on next level issues. Please read this discussion.

Documentation on `yarn demo`

We need to do a documentation or a video (slides with voice will do too) on the steps involved in a demo run, and how one can use that as a starting point to build their application for enhanced trust.

To give an example, the demo run contains below, but not many users may understand it:

  • DID creation
  • DID check on chain if it exits (did query)
  • DID Name creation & query
  • Authority signing and extrinsic authoring.
  • Schema creation/anchoring (schema format, and more details on why schema etc)
  • Registry creation (which needs some more explanation on registry concept itself)
    • how schema is an option to pass to registry.
  • Registry delegation (role based access control)
  • Registry authority delegation
  • IDocument (or stream) creation and stream anchoring
  • IDocument verification (includes 3 type of proof validations)
  • stream revoke
  • Checking of revoked IDocument.

[C4GT] Add SDK support for Chianspace `archive`

Description

This function archives a space based on the provided space ID. It checks whether the space exists, is not already archived, and is approved. Additionally, it verifies that the caller has the authority to archive the space, as indicated by the provided authorization ID.

Goals

  • Add methods in the chainspace module to support the archive feature.

Expected Outcome

We should be able to archive a chainspace.

Acceptance Criteria

  • Methods are in the correct files.
  • Build succeeds.
  • Methods work as expected.
  • Code is well-commented.

Implementation Details

Any chain call should be made in the ChainSpace.chain.ts file, and the preparation of extrinsic should be done in the ChainSpace.ts file.

Mockups / Wireframes

N/A


Product Name

CORD.js

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

TypeScript

Mentor(s)

@amarts, @adi-a11y, @vatsa287

Complexity

Medium

Category

Feature

RFE:docs - Provide documentation for content and stream methods

Anyone with some programming experience would understand 'schema' or 'space' structure as its not as complex as 'stream'.

We need to document the output and how to understand the output, what is verifiable etc through documentation for stream and content modules.

[C4GT] ChainSpace: Separate preparation of DelegateAuthorization extrinsic from chain dispatch

Description

Separate Delegate Authorization preparation and dispatch of extrinsic to chain. This would help when bulk transaction takes place so we just prepare all the required extrinsics and then execute these transaction in batches by dumping them into a promise using
a batch sign & submit utility ex, authorizeBatch which can take array of extrinsics, instead of just one.

Goals

  • Creation of new export function named prepareDelegateAuthorizationExtrinsic(), which will contain dispatchDelegateAuthorizationTx and Did.AuthorizeTx().
  • Integration of above method into existing dispatchDelegateAuthorization()

Implementation Details

Developers/Contributors can refer to example PRs: #188, #182


Product Name

CORD.JS

Organization Name

Dhiway

Domain

Blockchain, SDK Development, API

Tech Skills Needed

Typescript

Mentor(s)

@amarts @NiranjanAP @vatsa287 @adi-a11y

Complexity

[Low]

Category

[Performance Improvement], [Feature]

Sub Category

[API], [Refactoring], [Backend], [Beginner friendly]

[C4GT] ChainSpace: Separate preparation of create chainspace extrinsic from chain dispatch

Description

Separate chain-space creation preparation and dispatch of extrinsic to chain. This would help when bulk transaction takes place so we just prepare all the required extrinsics and then execute these transaction in batches by dumping them into a promise using
a batch sign & submit utility ex, authorizeBatch which can take array of extrinsics, instead of just one.

Goals

  • Creation of new export function named prepareCreateSpaceExtrinsic()
  • Integration of above method into existing dispatchToChain()

Implementation Details

Developers/Contributors can refer to example PRs: #188, #182


Product Name

CORD.JS

Organization Name

Dhiway

Domain

Blockchain, SDK Development, API

Tech Skills Needed

Typescript

Mentor(s)

@amarts @NiranjanAP @vatsa287 @adi-a11y

Complexity

[Low]

Category

[Performance Improvement], [Feature]

Sub Category

[API], [Refactoring], [Backend], [Beginner friendly]

build: issue while running `augment-api build:types`

getting below error when we run yarn workspace @cord.network/augment-api build:types

file:packages/augment-api/scripts/fixTypes.mjs:2
import glob from 'glob'
       ^^^^
SyntaxError: The requested module 'glob' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

handle 'object' type of data inside of the credential/stream/vc

When we add a field which is of the type 'object', the stream is created, and vc is generated. But the VC verification fails with hash value change (or digest check failing).

This needs to be fixed in sdk, with object's fields should be ordered properly during hash calculation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.