diff --git a/package.json b/package.json index 784a99e..30f7b94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zootools", - "version": "0.1.14", + "version": "0.1.15", "description": "ZooTools Decentraland SDK Library", "main": "./dist/index.js", "scripts": { diff --git a/src/entities/Booth/RTBooth.ts b/src/entities/Booth/RTPOAPBooth.ts similarity index 87% rename from src/entities/Booth/RTBooth.ts rename to src/entities/Booth/RTPOAPBooth.ts index 4497850..24919ca 100644 --- a/src/entities/Booth/RTBooth.ts +++ b/src/entities/Booth/RTPOAPBooth.ts @@ -4,8 +4,8 @@ import { signedFetch } from "@decentraland/SignedFetch"; import { AlertSystem } from "src/index"; import { Booth, IBoothProps } from "./Booth"; -export class RTBooth extends Entity { - booth: Booth; +export class RTPOAPBooth extends Entity { + public booth: Booth; constructor( public props: Partial, public rewardId: string, @@ -15,11 +15,11 @@ export class RTBooth extends Entity { this.addComponent(new Transform({})); this.booth = new Booth({ transformArgs: { position: new Vector3(8, 0, 8) }, - buttonText: `Get Attendance Token`, + buttonText: `Claim this POAP`, onButtonClick: () => { void executeTask(async () => { try { - log("POAP", { rewardId }) + log("Claiming POAP", { rewardId }) alertSystem.new("Attempting to claim POAP... Please wait...") const userData = await getUserData(); const realm = await getCurrentRealm(); @@ -36,14 +36,14 @@ export class RTBooth extends Entity { body: JSON.stringify({ address, displayName, - rewardId, + rewardId: this.rewardId, realm, timezone: new Date().toString(), }), }) let json = JSON.parse(response.text ?? ""); const { message } = json; - log(json) + log("Reward claim",{json}) alertSystem.new(message) } catch (err: any) { @@ -58,4 +58,7 @@ export class RTBooth extends Entity { }) this.booth.setParent(this); } + setRewardId(rewardId: string){ + this.rewardId = rewardId; + } } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 91773dc..7898cff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,6 @@ /// /// - /** * Classes */ @@ -25,7 +24,7 @@ export { Image } from './entities/Image' export { Model, IModelProps } from './entities/Model' export { ModelGroup, IModelGroupProps } from './entities/ModelGroup' export { POAPBooth, IPOAPBoothProps } from './entities/Booth/POAPBooth' -export { RTBooth } from './entities/Booth/RTBooth' +export { RTPOAPBooth } from './entities/Booth/RTPOAPBooth' export { Sound } from './entities/Sound' export { WearableBooth, IWearableBoothProps } from './entities/Booth/WearableBooth' export { ZooTools_Metronome } from './entities/Metronome/Metronome'