Explore Philand
  • Welcome to Phi
    • 🏝️What's Phi?
    • 🌄Mission
    • 🏃‍♀️Story
    • 🏄Phi Crew
  • ⚡Products
    • 🏝️Phi Land
      • 🔦User Guide for Phi Land
        • 0️⃣Before Playing Phi
          • 🦊Download a Crypto Wallet
          • 🟣Get $MATIC
          • 🔷Get an ENS Domain
        • 1️⃣Access Phi Land
        • 2️⃣Create your Phi Land
        • 3️⃣Claim Quest Objects
        • 4️⃣Purchase Items on Shop
        • 5️⃣Deposit Objects to Land
        • 6️⃣Build your land
        • 7️⃣Share your land on Twitter
      • 🎧Phi Music
      • ⛓️Hyperlinks & Link List
      • 💫Transferring Land
      • ↔️Phi Connect
    • ⚔️Phi Quest
      • 🔦User Guide for Phi Quest
        • 0️⃣Before Playing Phi
          • 🦊Download a Crypto Wallet
          • 🟣Get $MATIC
        • 1️⃣Access Phi Quest
        • 2️⃣Claim Quest Objects
          • Quest List
          • Adventure
          • Campaign
        • 3️⃣Purchase Items on Shop
        • 4️⃣Play Phi Land with Items you got
      • 🧑Account
      • 🏅Active Score Rank Quests
    • 🍭Phi Opportunity (beta)
    • 💎Phi Material
      • ⚒️Phi Craft
      • 🥗UGC Craft
    • 🔮OpenSea Collection Links
    • 💡How-to's
      • 🏷️Mastering ENS (Ethereum Name Service)
        • How to Register an ENS Domain Name
        • How to Renew an ENS Domain Name
        • How to Manage ENS records
          • How to set up the Avatar record in ENS
            • Using MintYourPFP to set an Avatar to an ENS name
        • How to Transfer ENS to Another Wallet
        • How to set up an ENS Subdomain
    • ❓FAQ
      • Must I have an ENS to play Phi Quest?
      • How can I get an ENS domain?
      • Why don't my ENS domains show up?
      • Can I use ENS subdomains for Phi Land?
      • What happens when I transfer ENS?
      • I can't create a land
      • Why cannot access to my land?
      • Why can't I change the baseplate?
      • Why can’t I claim Quest objects?
      • Any rewards for participating in Testnet?
      • What is Phi Quest?
      • How the Leaderboard on Phi Quest is calculated?
      • Why are there two EXPs?
      • I claimed objects on Phi Quest. How can I create my Phi Land?
      • Why can’t I see my objects in my wallet?
      • Can I trade Quest Objects?
      • Are traded objects included in my EXP calculation?
      • My EXP not showing, leaderboard not updating
      • Which browser should I use?
      • Which devices are supported?
      • How to update my Twitter OGP image (card)?
    • 📬Submit Feedback
      • Bug Report
      • Feature Request
      • User Survey
  • ⚙️DEVELOPERS
    • 🪴Create Philand
    • 🎨Objects NFT
      • ⛓️Quest Object
      • 🌾Free Object
      • 🧊Premium Object
      • 🍰Baseplate Object
      • 🧮Wallpaper Object
      • 💄Other Topics
      • 💡Appendix
    • 🛠️Use PhiMap
      • 🗺️Deposit/Withdraw
      • 🍧Save Philand
      • 👀View Function
      • 💡Appendix
    • 💝Philand API
      • ⌚Introduction
      • 🔑Authentication
        • 😄Use API key
        • 😍Get Access Token
        • 🤩Verify Access Token
        • 🤪Get Refresh Token
        • 😎Refresh JWT
      • 🫔Quest
        • 🎾Get Quest List
        • 🏀Get Quest Status
        • ⚽Trigger Eligible Check
        • 🎯Get Claimed Status
        • 🏓Get Verify Coupon
      • 🏝️Philand
        • 🫑View Philand Link
        • 🍍Get Philand Image
      • 🧸Account
        • 🍞Get Philand List
        • 👑Get PhiRank
      • 🎺Object
        • 🎸Get Object Info
      • 🦖Example Call
        • 🤠Quest Claim
      • 👔Related Links
    • 🧑‍🏫How to Verify your transaction
      • 👓Read Contract Method
      • 🚩Third-party API
      • 🦷Whitelist
    • 📄Contracts
      • 👮Audit
  • 💼Career
    • 👯Phi is hiring
  • 🔗Official links
    • Website
    • Twitter
    • Discord
    • Discourse
    • Medium
    • Github
    • Guild.xyz
    • Lenster
    • Instagram
Powered by GitBook
On this page
  • We'll show you how to get the quest object from your site.
  • First, please apply for an API key from here.
  • Next, please fetch the information related to your quest.
  • Then, please retrieve the coupon information from the query below.
  • Last, please call the contract with the latest obtained information.

Was this helpful?

  1. DEVELOPERS
  2. Philand API
  3. Example Call

Quest Claim

PreviousExample CallNextRelated Links

Last updated 1 year ago

Was this helpful?

We'll show you how to get the quest object from your site.

First, please apply for an API key from here.

Next, please fetch the information related to your quest.

{
    "Activities": "[\"buildspace V2 NFT Owner\"]", 
    "Condition": "BuildSpaceOwner", <- Condition
    "MetadataUrl": "https://www.arweave.net/bFKtd81gs2SREvS7fzUsw68bYedXeaBrQ8XFyJf77EE",
    "QuestURL": "https://quest.philand.xyz/items/0x3D8C06e65ebf06A9d40F313a35353be06BD46038/101901"
    "Name": "buildspace Achiever",
    "TokenId": "101901", 
    "Value": "1" <- value
}
  • metadataURl (including NFT image)

Then, please retrieve the coupon information from the query below.

Request

query questCoupon {
  questCoupon(input: {address: "0x5037e7...", condition: "ActiveScore", value: 5000}) {
    coupon {
      r
      s
      v
    }
  }
}

Response

{
 "data": {
    "questCoupon": {
      "coupon": {
        "r": "0xccd90b3476a8236484875f6f36e066b86ede0738b58422bc97bed6d80221b4c5",
        "s": "0x1c9499def2d08658dbaebae099d5e0fdfa5e776101617a4c06fa9afc6eec4b27",
        "v": 27
      }
    }
  }
}

Last, please call the contract with the latest obtained information.

const ethers = require('ethers');

// Set up wallet and provider
const provider = new ethers.providers.JsonRpcProvider('YOUR_RPC_URL');
const wallet = new ethers.Wallet('YOUR_PRIVATE_KEY', provider);

// Contract ABI (must include the appropriate function signature)
const contractAbi = [...];

// Create contract instance
// 0x754e78bC0f7B487D304552810A5254497084970C is phi contract
const contract = new ethers.Contract('0x754e78bC0f7B487D304552810A5254497084970C', contractAbi, wallet);

// Function parameters
const params = {
  ContractAddress: '0x3D8C06e65ebf06A9d40F313a35353be06BD46038', <- Quest Object NFT address
  tokenId: '100151',
  condition: 'ActiveScore5000',
  Coupon: {
    r: '0xccd90b3476a8236484875f6f36e066b86ede0738b58422bc97bed6d80221b4c5',
    s: '0x1c9499def2d08658dbaebae099d5e0fdfa5e776101617a4c06fa9afc6eec4b27',
    v: 27
  }
};

// Call the function (you must set the function name and parameters appropriately)
contract.claimQuestObject(params).then((result) => {
  console.log('Transaction result:', result);
}).catch((error) => {
  console.error('Error:', error);
});

PolygonScan()

⚙️
💝
🦖
🤠
😄Use API key
🎾Get Quest List
address