Skip to content

Commit 48626ca

Browse files
committed
feat: add new RPCs
ping_peers, get_transaction_proof, verify_transaction_proof and clear_banned_addresses
1 parent bfd881c commit 48626ca

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/ckb/api.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,27 @@ def remove_node(peer_id)
382382
rpc.remove_node(peer_id)
383383
end
384384

385+
def ping_peers
386+
rpc.ping_peers
387+
end
388+
389+
# @param tx_hashes [string[]]
390+
# @param block_hash [string]
391+
def get_transaction_proof(tx_hashes:, block_hash: nil)
392+
transaction_proof_h = rpc.get_transaction_proof(tx_hashes, block_hash)
393+
CKB::Types::TransactionProof.from_h(transaction_proof_h)
394+
end
395+
396+
397+
# @param proof [CKB::Types::TransactionProof]
398+
def verify_transaction_proof(proof)
399+
rpc.verify_transaction_proof(proof)
400+
end
401+
402+
def clear_banned_addresses
403+
rpc.clear_banned_addresses
404+
end
405+
385406
def inspect
386407
"\#<API@#{rpc.uri}>"
387408
end

0 commit comments

Comments
 (0)