1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

fresh package-lock

This commit is contained in:
Matthias Kretschmann 2019-11-14 19:42:36 +01:00
parent 7067b89fdc
commit 0552bcc577
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 3749 additions and 2012 deletions

5710
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -33,17 +33,21 @@ export default class DIDRegistry extends ContractBase {
}
public async getAttributesByOwner(owner: string): Promise<string[]> {
return (await this.getPastEvents('DIDAttributeRegistered', {
_owner: zeroX(owner)
}))
return (
await this.getPastEvents('DIDAttributeRegistered', {
_owner: zeroX(owner)
})
)
.map(({ returnValues }) => returnValues._did)
.map(didPrefixed)
}
public async getAttributesByDid(did: string): Promise<{ did: string; serviceEndpoint: string; checksum: string }> {
return (await this.getPastEvents('DIDAttributeRegistered', {
_did: didZeroX(did)
})).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({
return (
await this.getPastEvents('DIDAttributeRegistered', {
_did: didZeroX(did)
})
).map(({ returnValues: { _did, _checksum: checksum, _value: serviceEndpoint } }) => ({
did: didPrefixed(_did),
serviceEndpoint,
checksum

View File

@ -20,9 +20,11 @@ export class AccessSecretStoreCondition extends Condition {
}
public async getGrantedDidByConsumer(consumer: string): Promise<{ did: string; agreementId: string }[]> {
return (await this.getPastEvents('Fulfilled', {
_grantee: zeroX(consumer)
})).map(({ returnValues }) => ({
return (
await this.getPastEvents('Fulfilled', {
_grantee: zeroX(consumer)
})
).map(({ returnValues }) => ({
did: didPrefixed(returnValues._documentId),
agreementId: zeroX(returnValues._agreementId)
}))

View File

@ -23,10 +23,14 @@ export class AgreementStoreManager extends ContractBase {
}
public async getAgreement(agreementId: string) {
const { did, didOwner, templateId, conditionIds, lastUpdatedBy, blockNumberUpdated } = await this.call(
'getAgreement',
[zeroX(agreementId)]
)
const {
did,
didOwner,
templateId,
conditionIds,
lastUpdatedBy,
blockNumberUpdated
} = await this.call('getAgreement', [zeroX(agreementId)])
return {
did,
didOwner,

View File

@ -25,10 +25,15 @@ export class ConditionStoreManager extends ContractBase {
}
public async getCondition(conditionId: string) {
const { typeRef, state, timeLock, timeOut, blockNumber, lastUpdatedBy, blockNumberUpdated } = await this.call(
'getCondition',
[zeroX(conditionId)]
)
const {
typeRef,
state,
timeLock,
timeOut,
blockNumber,
lastUpdatedBy,
blockNumberUpdated
} = await this.call('getCondition', [zeroX(conditionId)])
return {
typeRef,
state: +state,

View File

@ -1,5 +1,5 @@
import { assert, spy, use } from 'chai'
import * as spies from 'chai-spies'
import spies from 'chai-spies'
import { SearchQuery } from '../../src/aquarius/Aquarius'
import { Ocean } from '../../src/ocean/Ocean'