Action
Standard action types defined in the PD-REL vocabulary.
Actions represent the specific activities or operations that can be performed on digital assets. These predefined actions cover common use cases, but custom actions can be defined using URIs.
Per the PD-REL v1.0 specification: "A specific activity or use, such as TRANSFER, REPRODUCE, or a custom action defined by a URI."
Examples
import { Action } from '@pd-institute/pd-rel-sdk';
// Using standard actions
const basicRule = {
action: Action.USE,
effect: 'permit'
};
const transferRule = {
action: Action.TRANSFER,
effect: 'permit',
constraints: [{ type: 'TOKEN_GATED', value: {...} }]
};
// Check if an action is standard
const isStandardAction = Object.values(Action).includes(userAction);
// Custom action using URI
const customRule = {
action: 'https://example.com/actions/stream',
effect: 'permit'
};
Definition
const Action: object
Properties
Action.USE
The general right to operate or make use of an asset.
USE is the broadest permission, typically covering activities like:
- Viewing or accessing digital content
- Playing media files
- Running software
- General interaction with the asset
Type: 'USE'
Value: 'USE'
Examples
// Allow basic usage
{ action: Action.USE, effect: 'permit' }
// Time-limited usage
{
action: Action.USE,
effect: 'permit',
constraints: [{ type: 'TIME_PERIOD', value: {...} }]
}
Action.TRANSFER
The right to change the ownership or control of the asset or rights.
TRANSFER covers ownership changes and rights delegation:
- Selling or gifting the asset
- Transferring NFT ownership
- Assigning rights to another party
- Delegating permissions
Type: 'TRANSFER'
Value: 'TRANSFER'
Examples
// Allow NFT holders to transfer
{
action: Action.TRANSFER,
effect: 'permit',
constraints: [{
type: 'TOKEN_GATED',
value: { contractAddress: '0xNFT...', minBalance: 1 }
}]
}
Action.REPRODUCE
The right to make copies of the asset.
REPRODUCE covers duplication and copying:
- Creating digital copies
- Downloading for offline use
- Backing up content
- Minting derivative NFTs
Type: 'REPRODUCE'
Value: 'REPRODUCE'
Examples
// Limited reproductions with payment
{
action: Action.REPRODUCE,
effect: 'permit',
constraints: [{ type: 'USAGE_COUNT', value: 10 }],
duties: [{ type: 'PAYMENT', value: {...} }]
}
Action.MODIFY
The right to create derivative works based on the asset.
MODIFY enables creative transformations:
- Editing or remixing content
- Creating derivative artworks
- Adapting code or software
- Translating or transforming media
Type: 'MODIFY'
Value: 'MODIFY'
Examples
// Allow modifications with attribution
{
action: Action.MODIFY,
effect: 'permit',
duties: [
{ type: 'ATTRIBUTION', value: 'Based on...' },
{ type: 'SHARE_ALIKE', value: 'ipfs://...' }
]
}
Action.DISPLAY
The right to show the asset publicly.
DISPLAY covers public presentation:
- Exhibiting in galleries or metaverses
- Showing on websites or social media
- Public screenings or performances
- Embedding in applications
Type: 'DISPLAY'
Value: 'DISPLAY'
Examples
// Allow display with attribution
{
action: Action.DISPLAY,
effect: 'permit',
duties: [{ type: 'ATTRIBUTION', value: 'Art by...' }]
}
Action.EXECUTE
The right to run or execute software or smart contract functions.
EXECUTE controls computational execution:
- Running software applications
- Calling smart contract methods
- Executing scripts or code
- Triggering automated processes
Type: 'EXECUTE'
Value: 'EXECUTE'
Examples
// Token-gated execution rights
{
action: Action.EXECUTE,
effect: 'permit',
constraints: [{
type: 'TOKEN_GATED',
value: { contractAddress: '0xDAO...', minBalance: 100 }
}]
}
Action.COMMERCIALIZE
The right to use the asset for commercial purposes.
COMMERCIALIZE enables profit-generating activities:
- Selling products featuring the asset
- Using in commercial advertising
- Licensing for business use
- Monetizing through various channels
Type: 'COMMERCIALIZE'
Value: 'COMMERCIALIZE'
Examples
// Prohibit commercial use
{ action: Action.COMMERCIALIZE, effect: 'prohibit' }
// Allow with revenue share
{
action: Action.COMMERCIALIZE,
effect: 'permit',
duties: [{ type: 'ROYALTY', value: { basisPoints: 1000 } }]
}
See Also
-
- Rule.action for usage in rules
- PolicyParser.isPermitted for permission checking
Since
Version 1.0.0