获取内部账户信息

要使用此功能,您必须拥有 API 密钥。请阅读这里以了解如何获取我们的 API 密钥。

通过 API 密钥获取帐户信息

GET https://api.tronsave.io/v2/user-info

速率限制 (Rate limit): 每1秒15个请求。

通过 API 密钥获取帐户信息

{
    "error": false,
    "message": "Success",
    "data": {
        "id": string, // 内部账户 ID
        "balance": string, // 内部账户余额(单位:SUN)
        "representAddress": string, // 内部账户作为订单请求者的表示地址
        "depositAddress": string, // 向此地址发送 TRX 以存入内部账户
    }
}

例子 (Example)

示例代码 (Example Code):

const GetAccountInfo = async (apiKey) => {
    const url = `${TRONSAVE_API_URL}/v2/user-info`
    const data = await fetch(url, {
        headers: {
            'apikey': apiKey
        }
    })
    const response = await data.json()
    /**
     * Example response 
    {
        "error": false,
        "message": "Success",
        "data": {
            "id": "67a2e6092...2e8b291da2",
            "balance": "373040535",
            "representAddress": "TTgMEAhuzPch...nm2tCNmqXp13AxzAd",
            "depositAddress": "TTgMEAhuzPch...2tCNmqXp13AxzAd"
        }
    }
     */
    return response
}

Last updated