Skip to content

Commit

Permalink
0.1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
tyzoo committed Jan 19, 2023
1 parent 93be9f7 commit a41af23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zootools",
"version": "0.1.14",
"version": "0.1.15",
"description": "ZooTools Decentraland SDK Library",
"main": "./dist/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<IBoothProps>,
public rewardId: string,
Expand All @@ -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();
Expand All @@ -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) {
Expand All @@ -58,4 +58,7 @@ export class RTBooth extends Entity {
})
this.booth.setParent(this);
}
setRewardId(rewardId: string){
this.rewardId = rewardId;
}
}
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
///<reference lib='es2015.collection' />
///<reference lib='es2015.iterable' />


/**
* Classes
*/
Expand All @@ -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'
Expand Down

0 comments on commit a41af23

Please sign in to comment.