Skip to content

Commit

Permalink
Update cord-demo-scripts for SDK compatibility (0.9.0-1beta6) (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
adi-a11y authored Dec 4, 2023
1 parent 927e839 commit 03a2824
Show file tree
Hide file tree
Showing 56 changed files with 4,755 additions and 2,341 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NETWORK_ADDRESS=ws://127.0.0.1:9944
ANCHOR_URI=//Alice
DID_NAME=solar.sailer
1,373 changes: 695 additions & 678 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"stream-bench": "tsx --no-cache demo/src/stream-bench"
},
"dependencies": {
"@cord.network/sdk": "^0.8.0-3"
"@cord.network/sdk": "0.9.0-1beta6",
"dotenv": "^16.3.1"
},
"devDependencies": {
"moment": "^2.29.1",
Expand Down
18 changes: 18 additions & 0 deletions res/address.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Basic Address Demo",
"description": "Address Demo Schema",
"$metadata": {
"version": "1.0.0",
"discoverable": true
},
"properties": {
"state": {
"type": "string"
},
"country": {
"type": "string"
}
},
"type": "object"
}
36 changes: 36 additions & 0 deletions res/certificate-bm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Student Certificate Demo:0x92f161334b11d354485140c2d32979ff87abb7cbe87affb6945f6b05524bab8d",
"properties": {
"certificateId": {
"type":"string"
},
"studentId": {
"type": "string"
},
"studentName": {
"type": "string"
},
"issuerName": {
"type": "string"
},
"credential": {
"type": "string"
},
"grade": {
"type": "string"
},
"batch": {
"type": "string"
},
"issuedOn": {
"type": "string",
"format": "date"
},
"validUntil": {
"type": "string",
"format": "date"
}
},
"type": "object"
}
36 changes: 36 additions & 0 deletions res/certificate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Student Certificate Demo",
"properties": {
"certificateId": {
"type":"string"
},
"studentId": {
"type": "string"
},
"studentName": {
"type": "string"
},
"issuerName": {
"type": "string"
},
"credential": {
"type": "string"
},
"grade": {
"type": "string"
},
"batch": {
"type": "string"
},
"issuedOn": {
"type": "string",
"format": "date"
},
"validUntil": {
"type": "string",
"format": "date"
}
},
"type": "object"
}
24 changes: 24 additions & 0 deletions res/cred.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.dway.in/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "did:cord:3yuH8SE1rPjYyzTS8np2Zpka2KXagbkcCV6dNBU75wcvjc1p",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:cord:3yT76V5nBADwojuHcgqnUWm27RpRP7cXEUA6kFo24deFxLev",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": {
"type": "Ed25519Signature2020",
"created": "2021-11-13T18:19:39Z",
"verificationMethod": "did:cord:3yuH8SE1rPjYyzTS8np2Zpka2KXagbkcCV6dNBU75wcvjc1p#0xfffff01dde2773a43c61bb28ab61b72b7656584eb1ea367b3bd8b4be55d63c41",
"proofPurpose": "assertionMethod",
"proofValue": "z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz"
}
}
13 changes: 13 additions & 0 deletions res/entity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Basic Entity Demo",
"properties": {
"name": {
"type": "string"
},
"country": {
"type": "string"
}
},
"type": "object"
}
38 changes: 38 additions & 0 deletions res/institute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Institute Accrediation Demo",
"properties": {
"instituteId": {
"type": "string"
},
"instituteName": {
"type": "string"
},
"establishmentYear": {
"type": "string",
"format": "date"
},
"gstnId":{
"type": "string"
},
"category": {
"type": "string"
},
"cgpaGrade":{
"type":"string"
},
"issuerName": {
"type": "string"
},
"issuedOn": {
"type": "string",
"format": "date"
},
"validUntil": {
"type": "string",
"format": "date"
}
},
"type": "object"
}

19 changes: 19 additions & 0 deletions res/nested.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$id": "http://cord.network/draft-01/schema#",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Nested Demo",
"description": "Nested Schema for Demo",
"$metadata": {
"version": "1.0.0",
"discoverable": true
},
"properties": {
"Student": {
"$ref": "baseSchema.schema.$id"
},
"Address": {
"$ref": "addressSchema.schema.$id"
}
},
"type": "object"
}
30 changes: 30 additions & 0 deletions res/network-rating.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$metadata": {
"version": "1.0.0",
"slug": "ondc-network-rating-demo-schema",
"discoverable": true
},
"title": "ONDC Network Rating Schema v1",
"description": "Test Schema",
"properties": {
"entityUid": { "type": "string" },
"entityId": { "type": "string" },
"providerUid": { "type": "string" },
"providerId": { "type": "string" },
"entityType": {
"type": "string",
"enum": ["Retail", "Logistic"]
},
"ratingType": {
"type": "string",
"enum": ["Overall", "Delivery"]
},
"referenceId": { "type": "string" },
"countOfTxn": { "type": "number" },
"totalRating": { "type": "number" }
},
"required": ["entityUid", "entityId", "providerUid", "providerId", "entityType", "ratingType", "countOfTxn", "totalRating"],
"additionalProperties": false,
"type": "object"
}
16 changes: 16 additions & 0 deletions res/npci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Identity Demo",
"properties": {
"type": {
"type": "string"
},
"verifiedName": {
"type": "string"
},
"id": {
"type": "integer"
}
},
"type": "object"
}
19 changes: 19 additions & 0 deletions res/prod-lisitng.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Demo Product Listing",
"properties": {
"store_name": {
"type": "string"
},
"description": {
"type": "string"
},
"price": {
"type": "string"
},
"location": {
"type": "string"
}
},
"type": "object"
}
37 changes: 37 additions & 0 deletions res/prod-order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Demo Product",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"countryOfOrigin": {
"type": "string"
},
"gtin": {
"type": "string"
},
"brand": {
"type": "string"
},
"manufacturer": {
"type": "string"
},
"model": {
"type": "string"
},
"sku": {
"type": "string"
},
"price": {
"type": "string"
},
"aggregateRating": {
"type": "string"
}
},
"type": "object"
}
34 changes: 34 additions & 0 deletions res/prod-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "Demo Product",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"countryOfOrigin": {
"type": "string"
},
"gtin": {
"type": "string"
},
"brand": {
"type": "string"
},
"manufacturer": {
"type": "string"
},
"model": {
"type": "string"
},
"sku": {
"type": "string"
},
"price": {
"type": "string"
}
},
"type": "object"
}
39 changes: 39 additions & 0 deletions res/schema-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Test Demo Schema v3",
"description": "Test Demo Schema",
"$metadata": {
"version": "1.0.0",
"slug": "test-demo-schema",
"discoverable": true
},
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer"
},
"id": {
"type": "string"
},
"country": {
"type": "string"
},
"address": {
"type": "object",
"properties": {
"street": { "type": "string" },
"pin": { "type": "integer" },
"location": {
"type": "object",
"properties": {
"state": { "type": "string" },
"country": { "type": "string" }
}
}
}
}
}
}
Loading

0 comments on commit 03a2824

Please sign in to comment.