Web SDKs
APIs
  • Internal APIs
  • External APIs
SDKs
  • Web SDKs
Projects
  • Aria
  • SOG
  • Zoomania
Examples
  • TMA Demo
APIs
  • Internal APIs
  • External APIs
SDKs
  • Web SDKs
Projects
  • Aria
  • SOG
  • Zoomania
Examples
  • TMA Demo
Rocket3Labs
    • SDK 功能概述
    • 嵌入方式(旧)
    • Telegram Stars 接入流程
    • 1. 开始集成
      • SDK引入
      • 1. 初始化
        THRIFT
      • 2. 嵌入游戏
        THRIFT
      • 3. 事件监听
        THRIFT
      • 4. 发送事件
        THRIFT
      • 5. 注销实例
        THRIFT
    • 2. 发送事件
      • 发送事件列表
      • 0.通用发送事件
        THRIFT
      • 1.ConnectAndTrade - 购买游戏道具支付事件
        THRIFT
      • 2.SendTGBotMessage - 发送TG消息
        THRIFT
      • 3.OpenWebLink - 打开网址
        THRIFT
      • 4.CopyToClipboard - 复制文本到剪贴板
        THRIFT
      • 5.Task - List - 任务列表
        THRIFT
      • 6.Task - Do - 做任务
        THRIFT
      • 7.Task - Verify - 验证任务
        THRIFT
    • 3. 监听事件
      • 监听事件列表
      • 0.通用监听事件
        THRIFT
      • 1. login - 登录事件(暂无)
        THRIFT
      • 2. BuyGamePropsResult - 购买游戏道具支付结果
        THRIFT
      • 3. MyNftListResult- 获取我的NFT列表
        THRIFT
      • 4. GetUserInfo - 获取用户信息
        THRIFT
      • 5. error - 错误事件(暂无)
        THRIFT
      • 6. sessionTimeout - 会话超时事件
        THRIFT
      • 7. connectionStatusChange - 连接状态变化事件
        THRIFT

    嵌入方式(旧)

    Iframe Event Type#

    Iframe Event Data#

    Common Response Data/通用数据字段#

    success
    {type: 0, error: null, success: true, target: "ton-wallet-iframe"}
    fail
    {type: 0, error:{Error Obj}, success: false, target: "ton-wallet-iframe"}

    Connect/Get Wallet Address 0/9999 连接钱包/获取钱包地址#

    request
    {type: 0, target: "ton-wallet-iframe-parent"}
    response
    {type: 0, userFriendlyAddress: "", rawAddress: "", target: "ton-wallet-iframe"}

    Connect & Pay 1 / 连接钱包并支付#

    request

    mint#

    payType = 0
    {type: 1, value:0.0001,token:"",orderid:"aaaaaa",item_id: 1111,item_name:'aaaa',item_category:"aaaa",payType: 0, target: "ton-wallet-iframe-parent"} //connect & mint

    buygameprops(购买游戏道具)#

    payType = 1
    pay usdt#
    payCurrency=0
    {type: 1, value:0.0001,token:"usdt address",orderid:"aaaaa",item_id: 1111,item_name:'aaaa',item_category:"aaaa",payType: 1, payCurrency:0,target: "ton-wallet-iframe-parent"} //connect & buygameprops

    pay ton#

    payCurrency=0
    token字段为空
    {type: 1, value:0.0001,token:"",orderid:"aaaaa",item_id: 1111,item_name:'aaaa',item_category:"aaaa",payType: 1, payCurrency:1,target: "ton-wallet-iframe-parent"} //connect & buygameprops

    pay stars#

    payCurrency=2
    value必须为整数
    {type: 1, value:1,token:"",orderid:"aaaaa",item_id: 1111,item_name:'aaaa',item_category:"aaaa",payType: 1, payCurrency:2,target: "ton-wallet-iframe-parent"} //connect & buygameprops
    参数说明
    payType(number): 支付业务类型: 0-mint, 1-购买游戏道具
    payCurrency(number): 支付货币: 0-usdt, 1-ton
    value(number):支付货币数量
    token: 支付货币的合约地址(ton和stars支付传空)
    orderid(string): 游戏侧生成的订单id
    item_id(string): 游戏侧购买物品的唯一id
    item_name(string): 游戏侧购买物品的名称
    item_category(string): 游戏侧购买物品的类别
    response
    {"type":1,success: true,error:null,target:"ton-wallet-iframe"}

    My NFT List 2 / 获取我的钱包地址对应的nft列表#

    request
    {type:2,target:"ton-wallet-iframe-parent"}
    response
    {"type":2,list:[],target:"ton-wallet-iframe"}
    my nft list data
    //My NFT List
    [
            {
                "address": "0:0277bd2e88d674e89b1cc056ef4734caefbf4bd76236719a0d400fac267e90d8",
                "index": 19,
                "owner": {
                    "address": "0:f8090225223c62512c228d11e22ccc17fe97705be7e66b350869ffdb3a5a68cd",
                    "is_scam": false,
                    "is_wallet": true
                },
                "collection": {
                    "address": "0:7e3514361c8fb6b62fd5eb513e1b8b1b9cd09af10f6cfc31fd59bef943026cbf",
                    "name": "Aria Game #1",
                    "description": "Aria NFT collection of unique NFTs created to showcase the TEP64 standard."
                },
                "verified": true,
                "metadata": {
                    "attributes": [
                        {
                            "trait_type": "#",
                            "value": "20"
                        }
                    ],
                    "description": "Thodoric Aria is the SBT of Aria Theme Game Park with unique design, it is also the identity of citizen within Aria world. With Thodoric Aria, users can unlock gameplay and get additional rewards such as airdrop and in-game assets.",
                    "id": 20,
                    "name": "Thodoric Aria #20",
                    "image": "https://assets.playariagame.com/aria-nft-assets/png/20.png"
                },
                "previews": [
                    {
                        "resolution": "5x5",
                        "url": "https://cache.tonapi.io/imgproxy/qTqBZvQL9I48M6_q56QO9OmBMIIxK2kiN2r9GklTSsc/rs:fill:5:5:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzIwLnBuZw.webp"
                    },
                    {
                        "resolution": "100x100",
                        "url": "https://cache.tonapi.io/imgproxy/Lte0ZU8caWJ9uN9U8JiZf59zJ1Bvb8mLOmFG_GYxQRk/rs:fill:100:100:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzIwLnBuZw.webp"
                    },
                    {
                        "resolution": "500x500",
                        "url": "https://cache.tonapi.io/imgproxy/-WxlcAKQM7oFBMWsRvOqKjN5XC7eBt0bfUt-j7WcZh4/rs:fill:500:500:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzIwLnBuZw.webp"
                    },
                    {
                        "resolution": "1500x1500",
                        "url": "https://cache.tonapi.io/imgproxy/7FkkyBNBliwG17c47KyVB00SyDGRdU9gZxxWaGMu2Ig/rs:fill:1500:1500:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzIwLnBuZw.webp"
                    }
                ],
                "approved_by": [],
                "trust": "none"
            },
            {
                "address": "0:570a0f842b405016aa901bf021a4654bf37a79c2a45fae55719ad59f4860a27b",
                "index": 16,
                "owner": {
                    "address": "0:f8090225223c62512c228d11e22ccc17fe97705be7e66b350869ffdb3a5a68cd",
                    "is_scam": false,
                    "is_wallet": true
                },
                "collection": {
                    "address": "0:7e3514361c8fb6b62fd5eb513e1b8b1b9cd09af10f6cfc31fd59bef943026cbf",
                    "name": "Aria Game #1",
                    "description": "Aria NFT collection of unique NFTs created to showcase the TEP64 standard."
                },
                "verified": true,
                "metadata": {
                    "id": 17,
                    "name": "Thodoric Aria #17",
                    "image": "https://assets.playariagame.com/aria-nft-assets/png/17.png",
                    "attributes": [
                        {
                            "trait_type": "#",
                            "value": "17"
                        }
                    ],
                    "description": "Thodoric Aria is the SBT of Aria Theme Game Park with unique design, it is also the identity of citizen within Aria world. With Thodoric Aria, users can unlock gameplay and get additional rewards such as airdrop and in-game assets."
                },
                "previews": [
                    {
                        "resolution": "5x5",
                        "url": "https://cache.tonapi.io/imgproxy/IYy0Yi4R4POjSBFJUeVbCBlc_6G1PL5e_jvDd0wp4YI/rs:fill:5:5:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzE3LnBuZw.webp"
                    },
                    {
                        "resolution": "100x100",
                        "url": "https://cache.tonapi.io/imgproxy/POInk80QDUvQ35XhlcZMzLakDmUEEYaG2DHQlpNMk90/rs:fill:100:100:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzE3LnBuZw.webp"
                    },
                    {
                        "resolution": "500x500",
                        "url": "https://cache.tonapi.io/imgproxy/gCVzWQnYAUF0sqPb4a9FsnydnSUCQXDBSLL2fNYM4-Y/rs:fill:500:500:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzE3LnBuZw.webp"
                    },
                    {
                        "resolution": "1500x1500",
                        "url": "https://cache.tonapi.io/imgproxy/ph8jPW3NrQ0mjvslA1BXYeITt-IGGyjvO90urrMc2Y4/rs:fill:1500:1500:1/g:no/aHR0cHM6Ly9hc3NldHMucGxheWFyaWFnYW1lLmNvbS9hcmlhLW5mdC1hc3NldHMvcG5nLzE3LnBuZw.webp"
                    }
                ],
                "approved_by": [],
                "trust": "none"
            },
            ...
        ]

    NFT Mint 3#

    request
    {type:3,address:"",target:"ton-wallet-iframe-parent"}
    response
    {"type":3,address:"",success:true,error:null,target:"ton-wallet-iframe"}

    Profile 4 / 用户信息#

    request
    {type:4,target:"ton-wallet-iframe-parent"}
    response
    {"type":4,success:true,error:null,profile:data,target:"ton-wallet-iframe"}
    profile data
    //User Profile
    {
            "uid": 4,
            "name": null,
            "screenName": null,
            "smallAvatar": null,
            "largeAvatar": null,
            "banner": null,
            "invitationCode": "aoi3",
            "pts": 0,
            "discord": null,
            "telegram": {
                "telegramUid": 368696677,
                "username": "peter201709",
                "firstname": "Peter",
                "lastname": ""
            },
            "walletAccountId": null
        }

    Web3 wallet bind 5 绑定ton的钱包地址#

    request
    {"type":5,"target":"ton-wallet-iframe-parent"}
    response
    {"type":5,address:"",success:true,error:null,"target":"ton-wallet-iframe"}

    TG Binded Wallet List 6 / tg用户的绑定钱包地址列表#

    request
    {type:6,target:"ton-wallet-iframe-parent"}
    response
    {"type":6,list:[],target:"ton-wallet-iframe"}

    Buy Game Props 7 / 购买游戏道具#

    request
    {type:3,address:"",target:"ton-wallet-iframe-parent"}
    response
    {"type":3,address:"",success:true,error:null,target:"ton-wallet-iframe"}

    Share 8 / 分享#

    request
    {type:8,target:"ton-wallet-iframe-parent"}
    response
    {"type":8,link:"http://t.me/.....",target:"ton-wallet-iframe"}

    Get Invite User ID List 9 / 获取邀请用户列表ID(已废弃)#

    request
    {type:9,target:"ton-wallet-iframe-parent"}
    response
    {"type":9,list:[1,2,3],target:"ton-wallet-iframe"}
    list
    [1,2,3]

    Send TG Bot Message 10 / 发送机器人消息#

    request
    {type:10,message:'message content',target:"ton-wallet-iframe-parent"}
    response
    {"type": 10,success:true,error:null,target:"ton-wallet-iframe"}

    Get Invite User List 11 / 获取邀请用户列表#

    request
    {type:11,target:"ton-wallet-iframe-parent"}
    response
    {"type":11,list:[],target:"ton-wallet-iframe"}
    list
    []

    Open Web Link 12 / 打开超链接#

    request
    {type:12,link: 'https://...',target:"ton-wallet-iframe-parent"}
    link: 要打开的超链接地址
    response
    {"type":12,success:true,error: null,target:"ton-wallet-iframe"}

    Copy Text To Clipboard 13 / 复制文本到剪切板#

    request
    {type:13,text: 'aaaaa',target:"ton-wallet-iframe-parent"}
    text: 要复制的文本
    response
    {"type":13,success:true,error: null,target:"ton-wallet-iframe"}

    Mission 100 / 任务#

    mission list 0 / 任务列表#

    request
    {"type":100,action: 0,"target":"ton-wallet-iframe-parent"}
    response
    {"type":100,action: 0,list:[],"target":"ton-wallet-iframe"}
    mission list data
    // Mission List
    [
            {
                "missionGroupId": 1,
                "title": "None",
                "missionList": []
            },
            {
                "missionGroupId": 50,
                "title": "Media",
                "missionList": [
                    {
                        "missionId": 1300,
                        "title": "Join Aria TG channel",
                        "brief": "简介a",
                        "description": "-",
                        "icon": "https://abs.twimg.com/favicons/twitter.3.ico",
                        "type": null,
                        "kind": 400,
                        "payload": "{\"url\":\"https://t.me/playaria_group\",\"channel\":\"playaria_group\"}",
                        "pts": 10,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 1,
                        "title": "Follow \"@PlayAriaGame\" on X",
                        "brief": "简介a",
                        "description": "-",
                        "icon": "https://abs.twimg.com/favicons/twitter.3.ico",
                        "type": null,
                        "kind": 201,
                        "payload": "{\"screenName\":\"PlayAriaGame\"}",
                        "pts": 2000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 4,
                        "title": "Call to Reply",
                        "brief": "简介a",
                        "description": "https://x.com/PlayAriaGame/status/1799463937299128576",
                        "icon": "https://abs.twimg.com/favicons/twitter.3.ico",
                        "type": null,
                        "kind": 300,
                        "payload": "{\"url\":\"https://twitter.com/intent/post?in_reply_to=1799463937299128576\",\"tweetId\":\"1799463937299128576\"}",
                        "pts": 1000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 10,
                        "title": "Call to Reply",
                        "brief": "简介a",
                        "description": "https://x.com/PlayAriaGame/status/1787508236071145869",
                        "icon": "https://abs.twimg.com/favicons/twitter.3.ico",
                        "type": null,
                        "kind": 300,
                        "payload": "{\"url\":\"https://twitter.com/intent/post?in_reply_to=1787508236071145869\",\"tweetId\":\"1787508236071145869\"}",
                        "pts": 1000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 5,
                        "title": "Call to Retweet",
                        "brief": "简介a",
                        "description": "https://x.com/PlayAriaGame/status/1799463937299128576",
                        "icon": "https://abs.twimg.com/favicons/twitter.3.ico",
                        "type": null,
                        "kind": 301,
                        "payload": "{\"url\":\"https://twitter.com/intent/retweet?tweet_id=1799463937299128576\",\"tweetId\":\"1799463937299128576\"}",
                        "pts": 1000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 6,
                        "title": "Call to Like",
                        "brief": "简介a",
                        "description": "https://x.com/PlayAriaGame/status/1799463937299128576",
                        "icon": "https://abs.twimg.com/favicons/twitter.3.ico",
                        "type": null,
                        "kind": 302,
                        "payload": "{\"url\":\"https://twitter.com/intent/like?tweet_id=1799463937299128576\",\"tweetId\":\"1799463937299128576\"}",
                        "pts": 1000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                ]
            },
            {
                "missionGroupId": 51,
                "title": "Tutorial",
                "missionList": [
                    {
                        "missionId": 2000,
                        "title": "注册",
                        "brief": "简介a",
                        "description": "-",
                        "icon": "-",
                        "type": null,
                        "kind": 200,
                        "payload": null,
                        "pts": 1000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 2101,
                        "title": "试玩游戏1",
                        "brief": "简介a",
                        "description": "-",
                        "icon": "-",
                        "type": null,
                        "kind": 200,
                        "payload": "{\"url\":\"tg://bot/game1\"}",
                        "pts": 2000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 2102,
                        "title": "试玩游戏2",
                        "brief": "简介a",
                        "description": "-",
                        "icon": "-",
                        "type": null,
                        "kind": 200,
                        "payload": "{\"url\":\"tg://bot/game1\"}",
                        "pts": 2000,
                        "ptsUnit": "PTS",
                        "finished": false
                    },
                    {
                        "missionId": 2103,
                        "title": "试玩游戏3",
                        "brief": "简介a",
                        "description": "-",
                        "icon": "-",
                        "type": null,
                        "kind": 200,
                        "payload": "{\"url\":\"tg://bot/game1\"}",
                        "pts": 2000,
                        "ptsUnit": "PTS",
                        "finished": false
                    }
                ]
            },
        ]

    web3 bind 1#

    request
    {"type":100,action: 1,"target":"ton-wallet-iframe-parent"}
    response
    {"type":100,action: 1,address:"",success:true,error:null,"target":"ton-wallet-iframe"}

    web3 unbind 2#

    request
    {"type":100,action: 2,"target":"ton-wallet-iframe-parent"}
    response
    {"type":100,action: 2,success:true,error:null,"target":"ton-wallet-iframe"}

    twitter bind 3#

    request
    {"type":100,action: 3,"target":"ton-wallet-iframe-parent"}
    response
    {"type":100,action: 3,success:true,error:null,data:{},"target":"ton-wallet-iframe"}

    twitter unbind 4#

    request
    {"type":100,action: 4,"target":"ton-wallet-iframe-parent"}
    response
    {"type":100,action: 4,success:true,error:null,"target":"ton-wallet-iframe"}

    mission do 5#

    request
    {"type":100,action: 5,missionInfo:{},"target":"ton-wallet-iframe-parent"}

    mission verify 6#

    request
    {"type":100,action: 6,missionid:1,"target":"ton-wallet-iframe-parent"}
    response
    {"type":100,action: 6,success:true,error:null,"target":"ton-wallet-iframe"}

    Iframe入参验证 8888 / 任务#

    request
    {"type":8888, "target":"ton-wallet-iframe-parent"}
    response
    {
                            type: 8888,
                            req: req,
                            success: true,
                            url: 'https://...?tgid=...&timestamp=...&token=...&uid=...&signature=...',
                            error: null,
                            target: 'ton-wallet-iframe'
                        }

    Iframe标签入参解析#

    tgid=...&timestamp=...&token=...&uid=...&signature=...
    验证方法
    上一页
    SDK 功能概述
    下一页
    Telegram Stars 接入流程
    Built with