📝 Share Your Feedback on Twitter and Claim 1M Free GetBlock Requests

bsv
Bitcoin-SV (BSV)

Method: POST signrawtransactionwithkey

dropdown

方法 RPC signrawtransactionwithkey 例如 Bitcoin-SV (BSV)

POST signrawtransactionwithkey

原始交易的签名输入(序列化、十六进制编码)。

第二个参数是一个 base58 编码的私钥数组,它将是用于签署交易的唯一密钥。

第三个可选参数(可能为空)是该交易依赖但可能尚未在区块链中的先前交易输出的数组。

Parameters

hexstring - 字符串,必填

交易十六进制字符串

privkeys - json 数组,必需

用于签名的 base58 编码私钥

prevtxs - json 数组,可选

之前的依赖交易输出

sighashtype - 字符串,可选,默认=ALL

签名哈希类型。必须是以下之一:

全部

没有任何

单身的

ALL|ANYONECANPAY

无|任何人都可以支付

单身|ANYONECANPAY

Request

curl --location --request POST 'https://bsv.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "signrawtransactionwithkey",
"params": ["hexstring", "privkeys", null, null],
"id": "getblock.io"}'


Response

null