Skip to content

Commit

Permalink
Add getApprovedDip721
Browse files Browse the repository at this point in the history
  • Loading branch information
dansteren committed Oct 19, 2023
1 parent 6e94863 commit a157604
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dapps/azle/dip721-nft/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,19 @@ export default Canister({
return Ok(state.nextTxid());
}
),
// Not exported as canister method because of incorrect interface.
// See https://github.com/Psychedelic/DIP721/issues/5
// getApprovedDip721: query([nat64], Result(Principal, Error), (tokenId) => {
// const nft = state.nfts[Number(tokenId)];

// if (nft === undefined) {
// return Err({ InvalidTokenId: null });
// }

// return nft.approved.Some === undefined
// ? Ok(ic.caller())
// : Ok(nft.approved.Some);
// }),
isApprovedForAllDip721: query([Principal], bool, (operator) => {
const operators = state.operators.get(ic.caller().toText());
const callerIsOperator =
Expand Down

0 comments on commit a157604

Please sign in to comment.