Skip to content

addCredentialAddresses

Used to set access control via allow and deny lists for specified addresses.

Official OceanProtocol documentation: DDO Specification

To remove addresses from an allow or deny list refer to removeCredentialAddresses()

Usage

allow
import { AssetBuilder, CredentialListTypes, Nautilus } from '@deltadao/nautilus'
import { Wallet } from 'ethers'
 
const nautilus = await Nautilus.create(new Wallet('0x1234'))
const assetBuilder =new AssetBuilder()
    
assetBuilder.addCredentialAddresses(CredentialListTypes.ALLOW, [  
    '0x0000000000000000000000000000000000000000'
]) 
const asset = assetBuilder.build() 
 
await nautilus.publish(asset) 
ddo:
{
credentials: {
allow: [
{
type: 'address'
values: ['0x0000000000000000000000000000000000000000']
}
]
}
}

Returns

The asset builder instance to chain building calls with.

Parameter

list

  • Type: CredentialListTypes

The list type you want to add to the asset to be built.

import { CredentialListTypes } from '@deltadao/nautilus'
 
assetBuilder.addCredentialAddresses(
    CredentialListTypes.ALLOW,  
    ['0x0000000000000000000000000000000000000000']
)

Supported list types

  • ALLOW
  • DENY

addresses

  • Type: string[]

The addresses you want to add to the specified list for the asset to be built.

assetBuilder.addCredentialAddresses(
    CredentialListTypes.ALLOW,
    ['0x0000000000000000000000000000000000000000'] 
)