RapidAPI logo

新規登録

ログイン

TrustedCoin

FREE
開発者 jseims
更新日 3ヶ月前
ファイナンス
1.3/10
人気度
1059ms
レイテンシ
-
正常稼働率

TrustedCoin API Documentation

Trusted Coin is a Bitcoin transaction cosigning service. Users of this API can create M-of-N multisignature P2SH addresses (where Trusted Coin acts as one of the cosigners). The policy logic Trusted Coin should apply when deciding if to cosign (and thus approve) individual transactions is user configurable. Via this mechanism higher-level services can be built including wallet protection schemes and escrow.

全文を表示する
POST/1/cosigner
POST/1/cosigner/<script_hash_address>/send_start
GET/1/cosigner/<script_hash_address>
POST/1/cosigner/<script_hash_address>/send_finish
POST/1/cosigner

Creates a cosigner enforcing a particular policy.

ヘッダーパラメータ
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
必須パラメータ
policySTRING
REQUIREDThe policy the cosigner should apply when deciding to sign a transaction or not. See the policy section for more information.
primary_keySTRING
REQUIREDThe first key in the M-of-N policy. This is a public key that corresponds to a private key that you control. This must be sent in hex-encoded SEC format (compressed and uncompressed varieties are both supported). Note: bitcoin addresses are not public keys - they are hashes of public keys. If you are using bitcoin-qt, you can use the "validateaddress" command line option to determine the public key associated with an address managed by your wallet. Example: 0345fb7c9a8eb70e9c83d5695cf6d93c5453ed83456badf166ebb77bf8b923e74f
パラメータ(Option)
secondary_keySTRING
OPTIONALThe second public key in the M-of-N policy. If provided, the P2SH multisignature requirement will be 2-of-3, otherwise it will be 2-of-2. The format of this key is the same as primary_key.
コードスニペット
unirest.post("https://jseims-trustedcoin.p.rapidapi.com/1/cosigner")
.header("X-RapidAPI-Host", "jseims-trustedcoin.p.rapidapi.com")
.header("X-RapidAPI-Key", "ログインしてキーを取得")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
サンプルレスポンス
ログイン新規登録

SDKをインストール(NodeJS)

インストール

Node.jsでUnirestを使用するには、NPMモジュールをインストールしてください。

$ npm install unirest

インストール完了後は、簡単にリクエストを行うことができるようになります。

var unirest = require('unirest');

リクエスト

unirest.post("https://jseims-trustedcoin.p.rapidapi.com/1/cosigner")
.header("X-RapidAPI-Host", "jseims-trustedcoin.p.rapidapi.com")
.header("X-RapidAPI-Key", "ログインしてキーを取得")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2認証
クライアントID
クライアントシークレット
OAuth2認証