Get transaction hashes - Bytecoin RPC Wallet API

From Bytecoin Wiki
Jump to: navigation, search

getTransactionHashes() method returns an array of block and transaction hashes.

Transaction consists of transfers. Transfer is an amount-address pair. There could be several transfers in a single transaction.


Input:

Argument Mandatory Description Format Example
addresses No Array of strings, where each string is an address array 2AFUzhkRatH2kQ19RaUNiE33mMQ3ejvJrGDhdDo77zn3RJQquQG7QBidoe7AD4EgBbChteaVesg3xcLVdq9EoCHH4NV9mxp
blockHash Only one of these parameters (blockHash or firstBlockIndex) is allowed. Hash of the starting block string f8f07ace392474bfbdc0fc30749a45f779a8aea10c489a103270f63ed88178ad
firstBlockIndex Only one of these parameters (blockHash or firstBlockIndex) is allowed. Starting height uint32 123123
blockCount Yes Number of blocks to return transaction hashes from uint32 20
paymentId No Valid payment_id string somePaymentId

Note: if paymentId parameter is set, getTransactionHashes() method returns transaction hashes of transactions that contain specified payment_id. (in the set block range)

Note: if addresses parameter is set, getTransactionHashes() method returns transaction hashes of transactions that contain transfer from at least one of specified addresses.

Note: if both above mentioned parameters are set, getTransactionHashes() method returns transaction hashes of transactions that contain both specified payment_id and transfer from at least one of specified addresses.


Output:

Argument Description Format Example
items Array that contains:
  • blockHash - string - hash of the block which contains transaction hashes
  • transactionHashes - array - array of strings, where each string is a transaction hash
array See below


Input example:

{  
  'params':{  
     'blockCount':100,
     'firstBlockIndex':0,
     'addresses':[  
        '2AFUzhkRatH2kQ19RaUNiE33mMQ3ejvJrGDhdDo77zn3RJQquQG7QBidoe7AD4EgBbChteaVesg3xcLVdq9EoCHH4NV9mxp'
     ]
  },
  'jsonrpc':'2.0',
  'id':'test',
  'method':'getTransactionHashes'
}

Output example:

{  
  'jsonrpc':'2.0',
  'id':'test',
  'result':{  
     'items':[  
        {  
           'transactionHashes':[  
               957dcbf54f327846ea0c7a16b2ae8c24ba3fa8305cc3bbc6424e85e7d358b44b
               25bb751814dd39bf46c972bd760e7516e34200f5e5dd02fda696671e11201f78
           ],
           'blockHash':'8a6f1cb7ed7a9db4751d7b283a0482baff20567173dbfae136c9bceb188e51c4'
        }
     ]
  }

}

Personal tools
Namespaces

Variants
Actions
Navigation
Tools