v3.2.1-beta.3 接口说明



  • 灯塔注册

    注册灯塔信息
    

    ./czzctl beaconregistration [{"txid":"4c545c3524cede29bae67796613dbb0f737992b4e346bda8e07c17896374f29a","vout":0}] {"toaddress":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20],"stakingamount":600,"assetflag":63,"fee":10,"keeptime":30,"whitelist":[],"coinbaseaddress":["czxl6822mcx0jad8adm9ljxfjx62cjf07ykk88a7xp"]}

    01000000014c545c3524cede29bae67796613dbb0f737992b4e346bda8e07c17896374f29a0000000000ffffffff020000000000000000526ac34c4ef84c8080809400000000000000000000000000000000000000148080c0c03f0a80c0ebaa637a786c363832326d6378306a61643861646d396c6a78666a783632636a663037796b6b383861377870005847f80d0000001976a914000000000000000000000000000000000000001488ac00000000

    toaddress 灯塔的地址
    stakingamount 质押金额
    assetflag 支持的币种 (把10进制的数字转为2进制,取后6位对应(BTC,BCH,BSV,LTC,USDT,DOGE),1 就是支持,0 不支持)
    fee 交易手续费 (czz个数,会根据当时汇率计算外币)
    keeptime 锁定时间 (燃币的外币,区块去计算)
    whitelist 外币白名单 (公钥,和币种)
    coinbaseaddress 挖矿地址,需要写czz地址


    创建交易 doge

    创建兑换交易,这个实例是狗狗币
    操作:
      首先先在Dogecoin上发一笔交易给和灯塔同公钥的地址,将狗狗币到地址上,然后在classzz主网发送一笔兑换的交易,使主网
      去核实是否是转到灯塔的地址,然后主网核实成功后,会在矿工交易里,将对应的czz发送到和狗狗币发送方同公钥的classzz地
      址上,这样就完成了一笔兑换交易,将狗狗币,兑换成czz
    

    ./czzctl exchangetransaction [{"txid":"8a56d6a6095baba959350726f0f68d6a0520f27f493322fd3f6f03afedc9ab32","vout":0}] [{"address":"cr3k7enc4ha867mx3k2y0t9x8u9z9wc5aglyskvxwu","bid":1,"assettype":240,"index":0,"height":3295847,"amount":10000000000,"exttxhash":"bd0f745c9fedb60bd1e199af80849b72613c15000c514e2003285198a3997d36"}]

    01000000018a56d6a6095baba959350726f0f68d6a0520f27f493322fd3f6f03afedc9ab320000000000ffffffff010000000000000000816ac64c7df87baa6372336b37656e633468613836376d78336b3279307439783875397a3977633561676c79736b7678777581f08083324a678502540be400b840626430663734356339666564623630626431653139396166383038343962373236313363313530303063353134653230303332383531393861333939376433360100000000

    address 狗狗同私钥生成的czz地址
    bid 灯塔id
    assettype 币种的类型(Doge: 0xF0, Ltc: 0xF1, Btc: 0xF2, Bsv: 0xF3, Bch: 0xF4)
    index 外网的交易的out的下标
    height 外网的交易上链的高度
    amount 外网的交易向灯塔的质押地址的狗狗地址上,发送的币的个数
    exttxhash 外网的交易的txhash


    燃币

    创建燃币申请交易
    操作:
        发起一个燃币的申请,这个需要燃币的额度(只有兑换过来的币才有额度,而且额度会随着区块逐渐减小)
    

    ./czzctl burntransaction [{"txid":"23d99145edb2aba3af6e638984dc9a76e8c5cd7e1f435cfe16823fdc3d4c14b5","vout":4}] {"assettype":240,"beaconid":1,"amount":3}

    010000000123d99145edb2aba3af6e638984dc9a76e8c5cd7e1f435cfe16823fdc3d4c14b50400000000ffffffff0200000000000000000d6ac40ac981f080808411e1a30000a3e111000000001976a914000000000000000000000000000000000000000088ac00000000

    assettype 燃币的币种类型(Doge: 0xF0, Ltc: 0xF1, Btc: 0xF2, Bsv: 0xF3, Bch: 0xF4)
    beaconid 灯塔的id
    amount 需要燃的czz币的个数


    燃币(灯塔)

    创建燃币申请交易
    操作:
        当灯塔操作完向指定地址发送token之后,然后在主网上发一笔通知交易,这个和上一笔燃币有关联性,需要上一笔交易的上链高度
        ,以及个数,地址等信息
    

    ./czzctl burnprooft [{"txid":"8eb86cef8e8c255059eaf82e55d9592c582d4c7e2d2fd51d512224553b2e704e","vout":0}] {"beaconid":1,"height":40,"amount":300000000,"address":"cr3k7enc4ha867mx3k2y0t9x8u9z9wc5aglyskvxwu","atype":240,"txhash":"28c1f349d687888f408392bb5a930852a5899502f98702d25d3786780134cd90","outindex":0}

    0100000001b1b5ccf9da454e496eb6842ecf70878b581d5d34592d12d58c4502eb3e1520f40000000000ffffffff010000000000000000806ac4514c7bf8798081908501bf08eb00aa6372336b37656e633468613836376d78336b3279307439783875397a3977633561676a6436347033656180b84032386331663334396436383738383866343038333932626235613933303835326135383939353032663938373032643235643337383637383031333463643930800100000000

    lightid 灯塔的id
    height 燃币申请上链的高度
    amount 燃币的czz个数
    address 燃币的地址
    atype 燃币的交易类型
    txhash 灯塔外网币打币的txhash
    outindex 交易的out
    isbeacon 是不是灯塔发送的


    燃币举报

    创建燃币举报交易
    操作:
        当用户在classzz主网提起燃币的申请后,灯塔需要根据申请把外部主网的token打到指定地址,规定在classzz的5000区块内
        ,如果没有向用户发token,需要发起燃币举报,和灯塔发的交易一样,需要上一笔交易的上链高度,以及个数,地址等信息
    

    ./czzctl burnprooft [{"txid":"78fa37e83761140329f994d35617deb7e8f90c8bb136be1effd9e3c7e55feccf","vout":0}] {"beaconid":1,"height":162,"amount":7500000000,"address":"cr3k7enc4ha867mx3k2y0t9x8u9z9wc5agjd64p3ea","assettype":240}

    010000000178fa37e83761140329f994d35617deb7e8f90c8bb136be1effd9e3c7e55feccf0000000000ffffffff0100000000000000003e6ac4513af8388081a28501bf08eb00aa6372336b37656e633468613836376d78336b3279307439783875397a3977633561676a643634703365618080808000000000

    beaconid 灯塔的id
    height 燃币申请上链的高度
    amount 燃币的czz个数
    address 燃币的地址
    assettype 燃币的交易类型


    白名单举报

    创建燃币举报交易
    操作:
        当外部的灯塔地址向白名单外的地址发送token,任何人都可以发送一条举报交易
    

    ./czzctl burnreportwhitelist [{"txid":"cd864c264fdd8aad4380571dd698f9dc88210907a4df248a717ff14a12dfbe94","vout":0}] {"beaconid":1,"assettype":240,"height":3297163,"txhash":"28c1f349d687888f408392bb5a930852a5899502f98702d25d3786780134cd90","inindex":0,"outindex":0,"amount":7500000000}

    0100000001cd864c264fdd8aad4380571dd698f9dc88210907a4df248a717ff14a12dfbe940000000000ffffffff010000000000000000576ac4524c52f850808083324f8bb8403238633166333439643638373838386634303833393262623561393330383532613538393935303266393837303264323564333738363738303133346364393080808501bf08eb0000000000

    beaconid 灯塔的id
    assettype 燃币的交易类型
    height 燃币申请上链的高度
    txhash 外网灯塔地址转出非白名单地址的交易hash
    inindex 外网交易UTXO的输入下标
    outindex 外网交易UTXO的输出下标
    amount 涉及的余额


    获取兑换比例

    获取兑换比例
    操作:
      获取当前的全网的兑换比例,以1个czz为计算
    

    ./czzctl getrateinfo

    {
    "DOGE":25,
    "LTC":0.0008,
    "BTC":21,
    "BCH":0.0008,
    "BSV":0.0008,
    }


    获取待灯塔发送的交易

    ./czzctl getburntxinfo

    [
    {
    "AssetType": 240,
    "Address" : "cr3k7enc4ha867mx3k2y0t9x8u9z9wc5agjd64p3ea",
    "BeaconID" : 1,
    "Amount" : 10,
    "Height" : 30,
    }
    ]


    根据用户的CZZ地址,获取该地址的可以兑换余额

    ./czzctl getaddressexchangeinfo "cr3k7enc4ha867mx3k2y0t9x8u9z9wc5agjd64p3ea"

    {
    "lastHeight": 200,
    "MaxRedeem": 50,
    }


    根据两个Token获取当前的汇率

    入参("DOGE","LTC","BTC","BCH","BSV","CZZ"), 取其中之二计算汇率, (BTC单位为'聪')
    

    ./czzctl getrateinfo "BTC" "CZZ"

    0.2


    根据两个Token获取当前的汇率

    入参("DOGE","LTC","BTC","BCH","BSV","CZZ"), 取其中之二计算汇率, (BTC单位为'聪')
    

    ./czzctl getrateinfo "BTC" "CZZ"

    0.2


    根据灯塔ID获取灯塔可以兑换的额度

    返回的参数单位为czz
    

    ./czzctl getbeaconexchangeasset 1

    200


    根据灯塔ID获取当前灯塔过期的可兑换余额

    ./czzctl getbeaconfreeasset 1

    {
    "DOGE":1,
    "LTC":1,
    "BTC":1,
    "BSV":1,
    "BCH":1,
    }


    根据灯塔ID获取当前未过期的主流资产

    返回的参数单位为czz
    

    ./czzctl getbeaconnooverdueasset 1

    200

    根据灯塔ID获取需要打币的列表信息

    ./czzctl getbeaconburninfo 1

    {
    "cr3k7enc4ha867mx3k2y0t9x8u9z9wc5agjd64p3ea":[
    {
    "amount":12,
    "height":12,
    "fee_r_amount":12,
    "redeem_state":1,
    }
    ]
    }


    一键兑换

      生成一个和兑换交易类似的hex,需要签名
    

    ./czzctl fastexchangetransaction [{"txid":"07189088eff197eccdfb1c2a42d83affe7549857161a82e028262ad49ed05a89","vout":0}] {"address":"cr3k7enc4ha867mx3k2y0t9x8u9z9wc5agjd64p3ea","beaconid":1,"assettype":240,"index":0,"height":3295847,"amount":10000000000,"exttxhash":"bd0f745c9fedb60bd1e199af80849b72613c15000c514e2003285198a3997d36"} {"assettype":240}

    address 狗狗同私钥生成的czz地址
    beaconid 灯塔id
    assettype 币种的类型(Doge: 0xF0, Ltc: 0xF1, Btc: 0xF2, Bsv: 0xF3, Bch: 0xF4)
    index 外网的交易的out的下标
    height 外网的交易上链的高度
    amount 外网的交易向灯塔的质押地址的狗狗地址上,发送的币的个数
    exttxhash 外网的交易的txhash

    assettype 燃币的币种类型(Doge: 0xF0, Ltc: 0xF1, Btc: 0xF2, Bsv: 0xF3, Bch: 0xF4)

    010000000107189088eff197eccdfb1c2a42d83affe7549857161a82e028262ad49ed05a890000000000ffffffff020000000000000000806ac64c7cf87aaa6372336b37656e633468613836376d78336b3279307439783875397a3977633561676a64363470336561808083324a678502540be400b84062643066373435633966656462363062643165313939616638303834396237323631336331353030306335313465323030333238353139386133393937643336800000000000000000096ac406c581f080808000000000


Log in to reply