Skip to content

Commit

Permalink
0.7.2 refactor - 02
Browse files Browse the repository at this point in the history
  • Loading branch information
smohan-dw committed May 21, 2022
1 parent 591cf92 commit 261d5ac
Show file tree
Hide file tree
Showing 26 changed files with 429 additions and 1,512 deletions.
20 changes: 11 additions & 9 deletions demo/src/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ async function main() {
} catch (e: any) {
console.log(e.errorCode, '-', e.message)
}
console.log('SDK', newSpace.spaceId)
console.log('SDK', newSpace.identifier)
console.log(
'SDK',
Cord.Utils.Identifier.getIdentifierHash(newSpace.spaceId, 'space:cord:')
Cord.Utils.Identifier.getIdentifierHash(newSpace.identifier, 'space:cord:')
)
// Step 2: Create a new Schema
console.log(`\n\n✉️ Adding a new Schema \n`)
Expand All @@ -86,10 +86,11 @@ async function main() {

let newSchema = Cord.Schema.fromSchemaProperties(
newSchemaContent,
employeeIdentity
employeeIdentity,
newSpace.identifier
)

let schemaCreationExtrinsic = await newSchema.create(newSpace.spaceId)
let schemaCreationExtrinsic = await newSchema.create()

console.log(`📧 Schema Details `)
console.dir(newSchema, { depth: null, colors: true })
Expand Down Expand Up @@ -121,24 +122,25 @@ async function main() {
country: 'India',
credit: 1000,
}
let schemaStream = Cord.Content.fromContentProperties(
let schemaStream = Cord.Content.fromContentStructure(
newSchema,
content,
employeeIdentity.address
)
console.log(`📧 Stream Details `)
console.dir(schemaStream, { depth: null, colors: true })

let newStreamContent = Cord.MarkContent.fromContentProperties(
let newStreamContent = Cord.ContentStream.fromContentProperties(
schemaStream,
employeeIdentity
employeeIdentity,
{ space: newSpace.identifier }
)
console.log(`\n📧 Hashed Stream `)
console.dir(newStreamContent, { depth: null, colors: true })

let newStream = Cord.Stream.fromMarkContentProperties(newStreamContent)
let newStream = Cord.Stream.fromContentStreamProperties(newStreamContent)

let streamCreationExtrinsic = await newStream.create(newSpace.spaceId)
let streamCreationExtrinsic = await newStream.create()
console.log(`\n📧 Stream On-Chain Details`)
console.dir(newStream, { depth: null, colors: true })

Expand Down
1 change: 0 additions & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"webpack-cli": "^4.5.0"
},
"dependencies": {
"@cord.network/exchange": "workspace:*",
"@cord.network/messaging": "workspace:*",
"@cord.network/modules": "workspace:*",
"@cord.network/network": "workspace:*",
Expand Down
2 changes: 0 additions & 2 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ export * as Messaging from '@cord.network/messaging'
export { ChainUtils } from '@cord.network/network'
export * as ChainHelpers from '@cord.network/network'
export * as Utils from '@cord.network/utils'
export * as Exchange from '@cord.network/exchange'
export { Request, Share } from '@cord.network/exchange'
export * from '@cord.network/types'
2 changes: 1 addition & 1 deletion packages/config/src/ConfigService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let configuration: configOpts = {

function checkAddress(): void {
if (!configuration.address) {
throw SDKErrors.ERROR_WS_ADDRESS_NOT_SET()
throw new SDKErrors.ERROR_WS_ADDRESS_NOT_SET()
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/credential/src/exportToVerifiableCredential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export function fromMark(
rootHash,
issuerSignature,
content,
contentId,
identifier,
} = input.request

// write root hash to id
const id = toCredentialIRI(
Identifier.getIdentifierKey(contentId, STREAM_PREFIX)
Identifier.getIdentifierKey(identifier, STREAM_PREFIX)
)

// transform & annotate stream to be json-ld and VC conformant
Expand Down
34 changes: 0 additions & 34 deletions packages/exchange/package.json

This file was deleted.

136 changes: 0 additions & 136 deletions packages/exchange/src/Request.ts

This file was deleted.

75 changes: 0 additions & 75 deletions packages/exchange/src/Share.ts

This file was deleted.

Loading

0 comments on commit 261d5ac

Please sign in to comment.