mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Move NFT interface types to @types
This commit is contained in:
parent
19b9ced779
commit
2c2fccdfb0
@ -11,3 +11,10 @@ export interface MetadataAndTokenURI {
|
|||||||
tokenURI: string
|
tokenURI: string
|
||||||
metadataProofs?: MetadataProof[]
|
metadataProofs?: MetadataProof[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface NftRoles {
|
||||||
|
manager: boolean
|
||||||
|
deployERC20: boolean
|
||||||
|
updateMetadata: boolean
|
||||||
|
store: boolean
|
||||||
|
}
|
||||||
|
@ -10,19 +10,9 @@ import {
|
|||||||
estimateGas
|
estimateGas
|
||||||
} from '../../utils'
|
} from '../../utils'
|
||||||
import { Contract } from 'web3-eth-contract'
|
import { Contract } from 'web3-eth-contract'
|
||||||
import { MetadataProof, MetadataAndTokenURI } from '../../@types'
|
import { MetadataProof, MetadataAndTokenURI, NftRoles } from '../../@types'
|
||||||
import { Config, ConfigHelper } from '../../config'
|
import { Config, ConfigHelper } from '../../config'
|
||||||
|
|
||||||
/**
|
|
||||||
* ERC721 ROLES
|
|
||||||
*/
|
|
||||||
interface Roles {
|
|
||||||
manager: boolean
|
|
||||||
deployERC20: boolean
|
|
||||||
updateMetadata: boolean
|
|
||||||
store: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Nft {
|
export class Nft {
|
||||||
public factory721Address: string
|
public factory721Address: string
|
||||||
public factory721Abi: AbiItem | AbiItem[]
|
public factory721Abi: AbiItem | AbiItem[]
|
||||||
@ -1173,9 +1163,9 @@ export class Nft {
|
|||||||
/** Get users NFT Permissions
|
/** Get users NFT Permissions
|
||||||
* @param {String} nftAddress erc721 contract adress
|
* @param {String} nftAddress erc721 contract adress
|
||||||
* @param {String} address user adress
|
* @param {String} address user adress
|
||||||
* @return {Promise<Roles>}
|
* @return {Promise<NftRoles>}
|
||||||
*/
|
*/
|
||||||
public async getNftPermissions(nftAddress: string, address: string): Promise<Roles> {
|
public async getNftPermissions(nftAddress: string, address: string): Promise<NftRoles> {
|
||||||
const nftContract = setContractDefaults(
|
const nftContract = setContractDefaults(
|
||||||
new this.web3.eth.Contract(this.nftAbi, nftAddress),
|
new this.web3.eth.Contract(this.nftAbi, nftAddress),
|
||||||
this.config
|
this.config
|
||||||
@ -1199,7 +1189,7 @@ export class Nft {
|
|||||||
/** Get users ERC20Deployer role
|
/** Get users ERC20Deployer role
|
||||||
* @param {String} nftAddress erc721 contract adress
|
* @param {String} nftAddress erc721 contract adress
|
||||||
* @param {String} address user adress
|
* @param {String} address user adress
|
||||||
* @return {Promise<Roles>}
|
* @return {Promise<boolean>}
|
||||||
*/
|
*/
|
||||||
public async isErc20Deployer(nftAddress: string, address: string): Promise<boolean> {
|
public async isErc20Deployer(nftAddress: string, address: string): Promise<boolean> {
|
||||||
const nftContract = setContractDefaults(
|
const nftContract = setContractDefaults(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user