MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / showRewardedStep

Function showRewardedStep

src/lib/adRewards.js:249–258  ·  view source on GitHub ↗
(offer, step, sessionId)

Source from the content-addressed store, hash-verified

247}
248
249async function showRewardedStep(offer, step, sessionId) {
250 const rewardedAd = await createRewardedAd(offer, step, sessionId);
251 const resultPromise = waitForRewardedResult(rewardedAd);
252 await rewardedAd.load();
253 await rewardedAd.show();
254 const result = await resultPromise;
255 if (!result.earned) {
256 throw new Error("Reward not earned. The ad was closed before completion.");
257 }
258}
259
260export default {
261 async init() {

Callers 1

watchOfferFunction · 0.85

Calls 4

createRewardedAdFunction · 0.85
waitForRewardedResultFunction · 0.85
loadMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected