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:
parent
7067b89fdc
commit
0552bcc577
5710
package-lock.json
generated
5710
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
@ -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)
|
||||
}))
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user