B. Coinstack SDK


This is a class to use Coinstack in an application. This class provides below functions.

1. Create and Close

1.1. Create

To make an instance of the class, one constructor should be called among three below.

  • CoinStackClient()
  • CoinStackClient(CredentialsProvider p, Endpoint ep)
  • CoinStackClient(CredentialsProvider p, Endpoint ep, String[] sslProtocols, String[] sslCipherSuites)

First one connects CoinstackMainNet(https://mainnet.cloudwallet.io). For this constructor, environment variables should be set; COINSTACK_ACCESS_KEY_ID and COINSTACK_SECRET_ACCESS_KEY.

Second one accepts two parameters; a private key and connection end point.

The last takes two more parameters in addition to the second; a version of SSL protocol for HTTPS and a parameter for Cipher Suite. TLSv1.2 and TLSv1 are defaults for SSL, and TLS_DHE_RSA_WITH_AES_127_CBC_SHA is default for Cipher Suite.

1.2. Close

  • void close()

It will be better to call this method to return resources of created CoinStackClient object immediately at no more usage.

2. Features

2.1. For Blockchain

  • BlockchainStatus getBlockchainStatus()

Get a status of the newest Blockchain. Please see BlockchainStatus in Coinstack Object for details.

2.2. For Block

  • Block getBlock(String blockId)

Get an information of Block with Block ID. Please see BlockchainStatus in Coinstack Object for details.

2.3. For Bitcoin Address

  • long getBalance(String address)
  • String[] getTransactions(String address)
  • Output[] getUnspentOutputs(String address)

2.4. For Transaction

  • String[] getTransactions(String address)
  • Output[] getUnspentOutputs(String address)
  • String createSignedTransaction(TransactionBuilder b, String privateKeyWIF)
  • String createMultiSigTransaction(TransactionBuilder b, List privateKeys, String redeemScript)
  • String createMultiSigTransactionWithPartialSign(TransactionBuilder b, String privateKey, String redeemScript)
  • String signMultiSigTransaction(String transactionSerialized, String myPrivateKey, String redeemScript)
  • void sendTransaction(String rawTransaction)

3. Advanced Features

3.1. For Notification

  • String addSubscription(Subscription sc)
  • void deleteSubscription(String id)
  • Subscription[] listSubscriptions()

3.2. For Stamping

  • String stampDocument(String documentHash)

results matching ""

    No results matching ""