Skip to content

Instantly share code, notes, and snippets.

View donma's full-sized avatar
:octocat:
I wanna play a game.

Donma Hsu donma

:octocat:
I wanna play a game.
View GitHub Profile
//轉換成 TRC20
static string ConvertHexToBase58Check(string hexAddress)
{
byte[] addressBytes = HexToBytes(hexAddress);
// 計算雙重 SHA-256 校驗碼
using (SHA256 sha256 = SHA256.Create())
{
protected void Page_Load(object sender, EventArgs e)
{
var product_id = "";
product_id = Request["id"];
if (string.IsNullOrEmpty(id))
//add using
using System.Web.Routing;
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
/// <summary>
/// 取得錢包資訊
/// </summary>
/// <param name="targetAddress"></param>
/// <returns></returns>
static GetAccountResponse GetAcccountResponse(string targetAddress)
{
options.AddPolicy("SecurePolicy",
policy => policy.WithOrigins("https://yourdomain.com") // 限制特定網域
.AllowMethods("GET", "POST") // 只允許 GET 和 POST
.AllowHeaders("Content-Type", "Authorization")); // 只允許特定標頭
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
public string Result { get; set; }
public void OnGet()
{
var queryParams = Request.Query.ToDictionary(q => q.Key, q => q.Value.ToString());
foreach (var p in queryParams)
{
<script async src="https://telegram.org/js/telegram-widget.js?22"
data-telegram-login="YOUR_BOT" data-size="large"
data-auth-url="https://YOUR_DOMAIN/tgauth" data-request-access="write">
</script>
public class GetTransactionByIdResponse
{
public List<Ret> ret { get; set; }
public List<string> signature { get; set; }
public string txID { get; set; }
public RawData raw_data { get; set; }
public string raw_data_hex { get; set; }
{
"ret":[
{
"contractRet":"SUCCESS"
}
],
"signature":[
"3d936cb99f0ee5f9b58bbf60d4c49c37df62af18fa0cbe38e10b6c84ed574bb26ccb94d5e5103d55cf53f77f48ea7bd59a4fa80051f377eecf2ed1f68ac960a91c"