Skip to content

Commit a157604

Browse files
committed
Add getApprovedDip721
1 parent 6e94863 commit a157604

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dapps/azle/dip721-nft/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,19 @@ export default Canister({
227227
return Ok(state.nextTxid());
228228
}
229229
),
230+
// Not exported as canister method because of incorrect interface.
231+
// See https://github.com/Psychedelic/DIP721/issues/5
232+
// getApprovedDip721: query([nat64], Result(Principal, Error), (tokenId) => {
233+
// const nft = state.nfts[Number(tokenId)];
234+
235+
// if (nft === undefined) {
236+
// return Err({ InvalidTokenId: null });
237+
// }
238+
239+
// return nft.approved.Some === undefined
240+
// ? Ok(ic.caller())
241+
// : Ok(nft.approved.Some);
242+
// }),
230243
isApprovedForAllDip721: query([Principal], bool, (operator) => {
231244
const operators = state.operators.get(ic.caller().toText());
232245
const callerIsOperator =

0 commit comments

Comments
 (0)