1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/src/keeper/auth.js
Sebastian Gerske 1d7597def8 DDD refactoring
2018-09-19 10:30:30 +02:00

30 lines
836 B
JavaScript

import ContractLoader from './contractLoader'
import KeeperBase from './keeper-base'
export default class OceanAuth extends KeeperBase {
constructor(web3, network) {
super(web3, network)
const instance = this
return {
async getInstance() {
instance.contract = ContractLoader.load('OceanAuth', instance._network, instance._web3)
return instance
}
}
}
cancelAccessRequest(orderId, senderAddress) {
return this.contract.cancelAccessRequest(orderId, { from: senderAddress })
}
getOrderStatus(orderId) {
return this.contract.statusOfAccessRequest(orderId)
}
getEncryptedAccessToken(orderId, senderAddress) {
return this.contract.getEncryptedAccessToken(orderId, { from: senderAddress })
}
}