Skip to content

Commit

Permalink
add support for Unlock grantKeyExtension method
Browse files Browse the repository at this point in the history
  • Loading branch information
haseebrabbani committed Aug 22, 2023
1 parent 5bf2fbb commit 3baac75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/unlock-admin/call.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ function expireAndRefundFor(tokenId, refundAmount) {
};
}

function grantKeyExtension(tokenId, duration) {
return {
func: simplify(contracts.publicLock.getFunction('grantKeyExtension')),
inputs: [tokenId, duration],
};
}

function simplify(func) {
return {
name: func.name,
Expand All @@ -85,5 +92,6 @@ module.exports = {
grantKeys,
updateLockConfig,
expireAndRefundFor,
grantKeyExtension,
getABI,
};
3 changes: 3 additions & 0 deletions scripts/unlock-admin/propose.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ function getCall(proposal) {
case 'expireAndRefundFor':
return call.expireAndRefundFor(args.tokenId, args.refundAmount);

case 'grantKeyExtension':
return call.grantKeyExtension(args.tokenId, args.duration);

default:
throw `unknown proposal type ${proposal.type}`;
}
Expand Down

0 comments on commit 3baac75

Please sign in to comment.