STARBASE
  • Introduction
    • Getting Started
  • Milestones & Roadmap
  • Integration
    • Advance Integration
    • Star Packages
    • Support Chains and Tokens
  • Referral Program
    • Mini-app Referral Program
    • Joining Starbase Referral Program
  • GOVERNANCE
    • STARBASE Token
      • Airdrop Criteria & Claim Details
  • Contact Us
    • Telegram
    • Twitter
Powered by GitBook
On this page
  • Customizing with Arguments
  • Referral Code (refcode)
  • Stars Package (stars)
  • Combining Multiple Arguments
  1. Integration

Advance Integration

PreviousMilestones & RoadmapNextStar Packages

Last updated 1 month ago

Integrating Starbase is quick and easy. Starbase is permissionless, meaning you don’t need to sign up before using our service.

In the current version, using the Starbase service does not require an SDK. Clients can access our payment page by directly calling our mini-app via this link:

https://t.me/starbasetg_bot/app

Customizing with Arguments

Our mini-app allows arguments to be passed in the URL. Use an underscore _ to separate multiple arguments and a dash - to assign values to specific arguments.

Referral Code (refcode)

Starbase offers a referral program based on monthly revenue generated through referred clients. Participants in this program can earn rebates of up to 40% of the monthly revenue.

Note that registering for the referral program requires prior approval from Starbase.

For details about the referral program and how to register, .

Example

Client Referral Code = novaxyz

https://t.me/starbasetg_bot/app?startapp=refcode-novaxyz

Stars Package (stars)

Starbase enables clients to specify the package on the purchasing page by providing the package ID.

For details about the available packages in our protocol, .

Example

Client wants to set the package to 500 Stars

https://t.me/starbasetg_bot/app?startapp=stars-500

Combining Multiple Arguments

To pass multiple arguments in the URL, use an underscore (_) to separate them. The order of the arguments does not affect the outcome.

https://t.me/starbasetg_bot/app?startapp=refcode-novaxyz_stars-500
https://t.me/starbasetg_bot/app?startapp=stars-500_refcode-novaxyz

Example Code

import React from "react";

const App = () => {
  const ref_code = "novaxyz";
  const star_package = 500;
  const url = `https://t.me/starbase_bot?startapp=refcode-${ref_code}_stars-${star_package}`;

  return (
    <button 
      onClick={() => window.open(url, "_blank")}
    >
      Buy {star_package} stars on Starbase
    </button>
  );
};

export default App;
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Starbase : Revolutionize Telegram Star Purchases With Crypto From Any Chain</title>
</head>
<body>
  <button id="buyButton">Buy</button>

  <script>
    const ref_code = "novaxyz";
    const star_package = 500;
    const url = `https://t.me/starbase_bot?startapp=refcode-${ref_code}_stars-${star_package}`;

    const button = document.getElementById("buyButton");
    button.textContent = `Buy ${star_package} stars on Starbase`;

    button.addEventListener("click", () => {
      window.open(url, "_blank");
    });
  </script>
</body>
</html>
"""app.py"""
from telegram import Update
from telegram.ext import ApplicationBuilder, CallbackContext, CommandHandler
from credentials import BOT_TOKEN, BOT_USERNAME

# Configuration variables
REF_CODE = "novaxyz"
STAR_PACKAGE = 500

# Command handler for /buy_star
async def buy_star(update: Update, context: CallbackContext):
    # Generate the URL dynamically
    url = f"https://t.me/starbase_bot?startapp=refcode-{REF_CODE}_stars-{STAR_PACKAGE}"
    
    # Send a message with the URL
    await update.message.reply_text(
        f"Click the link below to buy {STAR_PACKAGE} stars on Starbase:\n\n{url}"
    )

if __name__ == '__main__':
    # Create the bot application
    application = ApplicationBuilder().token(BOT_TOKEN).build()

    # Add command handlers
    application.add_handler(CommandHandler('buy_star', buy_star))

    # Start the bot
    print(f"Your bot is listening! Navigate to http://t.me/{BOT_USERNAME} to interact with it!")
    application.run_polling()
click here
click here