Skip to content

Commit

Permalink
fix: add additional data to quest step for fhenix
Browse files Browse the repository at this point in the history
  • Loading branch information
andywong418 committed Jan 22, 2024
1 parent 672a05a commit c110b20
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
15 changes: 14 additions & 1 deletion wondrous-bot-admin/src/components/CreateTemplate/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PAYMENT_OPTIONS } from "components/Rewards/constants";
import { getPathArray, toCent } from "utils/common";
import { QUEST_STATUSES, TYPES, APEIRON_TYPES } from "utils/constants";
import { QUEST_STATUSES, TYPES, APEIRON_TYPES, FHENIX_FAUCET_ADDRESS } from "utils/constants";
import { mapAnswersToOptions, reduceConditionalRewards } from "./utils";
import { ValidationError } from "yup";
import { set } from "lodash";
Expand Down Expand Up @@ -109,6 +109,19 @@ const processSteps = (steps) =>
};
} else if (next.type === TYPES.VERIFY_MARKETSFLARE_TRIAL || Object.values(APEIRON_TYPES).includes(next.type)) {
step.prompt = next.value;
} else if (
next.type === TYPES.VERIFY_FHENIX_ACTIVE_WALLET ||
next.type === TYPES.VERIFY_FHENIX_CONTRACTS_CREATED ||
next.type === TYPES.VERIFY_FHENIX_FAUCET_INTERACTION ||
next.type === TYPES.VERIFY_FHENIX_WALLET_GAS_USAGE
) {
step.prompt = next.value?.prompt;
step["additionalData"] = {
chain: "fhenix",
};
if (next.type === TYPES.VERIFY_FHENIX_FAUCET_INTERACTION) {
step["additionalData"]["contractAddress"] = FHENIX_FAUCET_ADDRESS;
}
}
return [...acc, step];
}, []);
Expand Down
11 changes: 6 additions & 5 deletions wondrous-bot-admin/src/utils/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export const APEIRON_TYPES = {
};

export const FHENIX_TYPES = {
VERIFY_FHENIX_WALLET_GAS_USAGE: "verify_fhenix_wallet_gas_usage",
VERIFY_FHENIX_CONTRACTS_CREATED: "verify_fhenix_contracts_created",
VERIFY_FHENIX_FAUCET_INTERACTION: "verify_fhenix_faucet_interaction",
VERIFY_FHENIX_ACTIVE_WALLET: "verify_fhenix_active_wallet",
VERIFY_FHENIX_WALLET_GAS_USAGE: "gas_usage",
VERIFY_FHENIX_CONTRACTS_CREATED: "contract_created",
VERIFY_FHENIX_FAUCET_INTERACTION: "contract_interaction",
VERIFY_FHENIX_ACTIVE_WALLET: "active_wallet",
};

export const APEIRON_ORG_ID = "98989259425317451";
Expand Down Expand Up @@ -468,12 +468,13 @@ export const CUSTOM_INTEGRATIONS = {
name: "Apeiron",
integrations: APEIRON_INTEGRATIONS,
},
"105517885016768513": {
"89444950095167649": {
name: "Fhenix",
integrations: FHENIX_INTEGRATIONS,
},
};

export const FHENIX_FAUCET_ADDRESS = "0x42B1909dbE62ad89a86095B6F7AC74690Bd8449C";
export const OPTION_TEXT_LIMIT = 250;

export const STORE_ITEM_TYPES = {
Expand Down

0 comments on commit c110b20

Please sign in to comment.