Skip to content

Commit

Permalink
fix: add track function missing params
Browse files Browse the repository at this point in the history
  • Loading branch information
aaitor committed Aug 10, 2023
1 parent 42e81e9 commit fe700e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/sdk-dtp",
"version": "0.7.0-rc2",
"version": "0.7.0-rc3",
"description": "Javascript SDK for connecting with Nevermined Data Platform (Data Transfer proofs module)",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -39,12 +39,11 @@
"web3-utils": "^1.7.4"
},
"peerDependencies": {
"@nevermined-io/sdk": "^2.0.0-rc5"
"@nevermined-io/sdk": "^2.0.0-rc7"
},
"devDependencies": {
"@faker-js/faker": "^6.3.1",
"@nevermined-io/sdk": "^2.0.0-rc5",
"ethers": "^6.6.5",
"@nevermined-io/sdk": "^2.0.0-rc7",
"@release-it/bumper": "^1.4.1",
"@truffle/hdwallet-provider": "^1.0.42",
"@types/chai": "^4.2.12",
Expand All @@ -68,6 +67,7 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tsdoc": "^0.2.16",
"ethers": "^6.6.5",
"ganache": "^7.0.2",
"lcov-result-merger": "^3.1.0",
"mocha": "^7.2.0",
Expand Down
24 changes: 18 additions & 6 deletions src/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ export class AccessProofService extends Instantiable
const metadata = ddo.findServiceByType('metadata').attributes.main
return this.select(metadata).accept(params)
}
public async track(params: ValidationParams): Promise<boolean> {
public async track(
params: ValidationParams,
from: Account,
txparams?: TxParameters,
): Promise<boolean> {
const ddo = await this.nevermined.assets.resolve(params.did)
const metadata = ddo.findServiceByType('metadata').attributes.main
return this.select(metadata).accept(params)
return this.select(metadata).track(params, from, txparams)
}

private isDTP(main: MetaDataMain): boolean {
Expand Down Expand Up @@ -167,10 +171,14 @@ export class NFTAccessProofService extends Instantiable
return this.select(metadata).accept(params)
}

public async track(params: ValidationParams): Promise<boolean> {
public async track(
params: ValidationParams,
from: Account,
txparams?: TxParameters,
): Promise<boolean> {
const ddo = await this.nevermined.assets.resolve(params.did)
const metadata = ddo.findServiceByType('metadata').attributes.main
return this.select(metadata).track(params)
return this.select(metadata).track(params, from, txparams)
}

private isDTP(main: MetaDataMain): boolean {
Expand Down Expand Up @@ -235,10 +243,14 @@ export class NFTSalesProofService extends Instantiable
return this.select(metadata).accept(params)
}

public async track(params: ValidationParams): Promise<boolean> {
public async track(
params: ValidationParams,
from: Account,
txparams?: TxParameters,
): Promise<boolean> {
const ddo = await this.nevermined.assets.resolve(params.did)
const metadata = ddo.findServiceByType('metadata').attributes.main
return this.select(metadata).track(params)
return this.select(metadata).track(params, from, txparams)
}

private isDTP(main: MetaDataMain): boolean {
Expand Down

0 comments on commit fe700e6

Please sign in to comment.