区块链上读写数据

该代码示例展示了如何使用BSVSimpleLibrary在比特币SV(BSV)区块链上进行数据操作,包括准备私钥、目标地址,以及发送带有OP_RETURN数据的交易,同时提供了获取OP_RETURN数据、交易详情和未花费交易输出(UTXO)的方法。
摘要由CSDN通过智能技术生成

在区块上读写数据

using System;
using BsvSimpleLibrary;
using System.Collections.Generic;
namespace bsvAddress
{
    class Program
    {
        static void Main(string[] args)
        {
            string WifprivateKeyStr = "cVkkQ9gmQWb7M7FKKSAnKzkj5b3VJfHZath9YzvtzWqSyshpjLdX";
            string destAddress = "1L5D9V3hZQ4iFsXSXv41cwhyurLteP6kH1";//test
            string privateKey = ""; //(test) your private key
            string txid = "dfd5dbaac7cbc322995fc2f33dabff4d947a172f97f09933a5bc5e08f47760f1";
            string uri = bsvConfiguration_class.RestApiUri;
            string network = bsvConfiguration_class.testNetwork;
            string opReturnData = "bsv test";

            Dictionary<string, string> response;

            send bsv and / or write data.
            // response = bsvTransaction_class.send(WifprivateKeyStr, 0, network,null, null, opReturnData, 1, 0);
           
            //get opreturn data
            string s = RestApi_class.getOpReturnData(uri, network, txid, bsvConfiguration_class.encoding);

            //get tx
            //RestApiTransaction tx = RestApi_class.getOpReturnData(uri, network, txid);

            //get utxo
            //RestApiUtxo_class[] utxos = RestApiUtxo_class.Equals(uri, network, destAddress);

            //get bsv price based on usdt from okex
            //double price = BsvPrice_class.getBsvPriceOnUSDT();
            //double priceOnSat = BsvPrice_class.getSatoshiPriceOnCent();
        
        }

    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值