[][src]Trait liquid_rpc::LiquidRpcApi

pub trait LiquidRpcApi: Sized {
    fn call<T: for<'a> Deserialize<'a>>(
        &self,
        cmd: &str,
        args: &[Value]
    ) -> Result<T>; fn get_block_header_raw(&self, hash: &Hash) -> Result<BlockHeader> { ... }
fn get_block_header_verbose(
        &self,
        hash: &Hash
    ) -> Result<GetBlockHeaderResult> { ... }
fn get_blockchain_info(&self) -> Result<GetBlockchainInfoResult> { ... }
fn get_raw_transaction(
        &self,
        txid: &Hash,
        block_hash: Option<&Hash>
    ) -> Result<Transaction> { ... }
fn get_raw_transaction_verbose(
        &self,
        txid: &Hash,
        block_hash: Option<&Hash>
    ) -> Result<GetRawTransactionResult> { ... }
fn send_to_address(
        &self,
        address: &str,
        amount: f64,
        comment: Option<&str>,
        comment_to: Option<&str>,
        substract_fee: Option<bool>,
        replaceable: Option<bool>,
        confirmation_target: Option<u32>,
        estimate_mode: Option<EstimateMode>,
        asset_label: Option<&str>,
        ignore_blind_fail: Option<bool>
    ) -> Result<Hash> { ... }
fn create_raw_transaction_hex(
        &self,
        utxos: &[CreateRawTransactionInput],
        outs: &HashMap<String, f64>,
        locktime: Option<i64>,
        replaceable: Option<bool>,
        assets: Option<&HashMap<String, AssetId>>
    ) -> Result<String> { ... }
fn create_raw_transaction(
        &self,
        utxos: &[CreateRawTransactionInput],
        outs: &HashMap<String, f64>,
        locktime: Option<i64>,
        replaceable: Option<bool>,
        assets: Option<&HashMap<String, AssetId>>
    ) -> Result<Transaction> { ... }
fn fund_raw_transaction<R: RawTx>(
        &self,
        tx: R,
        options: Option<&FundRawTransactionOptions>,
        is_witness: Option<bool>
    ) -> Result<FundRawTransactionResult> { ... }
fn sign_raw_transaction_with_wallet<R: RawTx>(
        &self,
        tx: R,
        utxos: Option<&[SignRawTransactionInput]>,
        sighash_type: Option<SigHashType>
    ) -> Result<SignRawTransactionResult> { ... }
fn sign_raw_transaction_with_key<R: RawTx>(
        &self,
        tx: R,
        privkeys: &[PrivateKey],
        prevtxs: Option<&[SignRawTransactionInput]>,
        sighash_type: Option<SigHashType>
    ) -> Result<SignRawTransactionResult> { ... }
fn send_raw_transaction<R: RawTx>(&self, tx: R) -> Result<Hash> { ... }
fn list_unspent(
        &self,
        minconf: Option<usize>,
        maxconf: Option<usize>,
        addresses: Option<&[&str]>,
        include_unsafe: Option<bool>,
        query_options: Option<&ListUnspentQueryOptions>
    ) -> Result<Vec<ListUnspentResultEntry>> { ... }
fn list_transactions(
        &self,
        count: Option<usize>,
        skip: Option<usize>,
        include_watch_only: Option<bool>
    ) -> Result<Vec<ListTransactionsResultEntry>> { ... }
fn list_since_block(
        &self,
        block_hash: Option<&Hash>,
        target_confirmations: Option<u32>,
        include_watch_only: Option<bool>,
        include_removed: Option<bool>
    ) -> Result<ListSinceBlockResult> { ... }
fn get_new_address(
        &self,
        label: Option<&str>,
        address_type: Option<AddressType>
    ) -> Result<String> { ... }
fn get_raw_change_address(
        &self,
        address_type: Option<AddressType>
    ) -> Result<String> { ... }
fn validate_address(&self, address: &str) -> Result<ValidateAddressResult> { ... }
fn get_address_info(&self, address: &str) -> Result<GetAddressInfoResult> { ... }
fn get_tx_out(
        &self,
        txid: &Hash,
        vout: u32,
        include_mempool: Option<bool>
    ) -> Result<Option<GetTxOutResult>> { ... }
fn get_balance(
        &self,
        min_confirmations: Option<u32>,
        include_watch_only: Option<bool>
    ) -> Result<HashMap<String, Amount>> { ... }
fn get_balance_asset(
        &self,
        asset_label: &str,
        min_confirmations: Option<u32>,
        include_watch_only: Option<bool>
    ) -> Result<Amount> { ... }
fn get_unconfirmed_balance(&self) -> Result<HashMap<String, Amount>> { ... }
fn get_received_by_address(
        &self,
        address: &str,
        min_confirmations: Option<u32>
    ) -> Result<HashMap<String, Amount>> { ... }
fn get_received_by_address_asset(
        &self,
        address: &str,
        asset_label: &str,
        min_confirmations: Option<u32>
    ) -> Result<Amount> { ... }
fn get_sidechain_info(&self) -> Result<GetSidechainInfoResult> { ... }
fn get_pegin_address(&self) -> Result<GetPeginAddressResult> { ... }
fn create_raw_pegin<R: RawTx, B: AsRef<[u8]>>(
        &self,
        raw_bitcoin_tx: R,
        txout_proof: B,
        claim_script: Option<&Script>
    ) -> Result<CreateRawPeginResult> { ... }
fn claim_pegin<R: RawTx, B: AsRef<[u8]>>(
        &self,
        raw_bitcoin_tx: R,
        txout_proof: B,
        claim_script: Option<&Script>
    ) -> Result<Hash> { ... }
fn init_pegout_wallet(
        &self,
        bitcoin_descriptor: &ExtendedPubKey,
        bip32_counter: Option<ChildNumber>,
        liquid_pak: Option<&str>
    ) -> Result<InitPegoutWalletResult> { ... }
fn send_to_main_chain(
        &self,
        amount: Amount,
        subtract_fee_from_amount: Option<bool>
    ) -> Result<SendToMainChainResult> { ... }
fn get_wallet_pak_info(&self) -> Result<GetWalletPakInfoResult> { ... }
fn get_pak_info(&self) -> Result<GetPakInfoResult> { ... }
fn tweak_fedpeg_script(
        &self,
        claim_script: &Script
    ) -> Result<TweakFedpegScriptResult> { ... }
fn list_issuances(
        &self,
        asset: Option<AssetId>
    ) -> Result<Vec<ListIssuancesResult>> { ... }
fn issue_asset(
        &self,
        asset_amount: Amount,
        token_amount: Amount,
        blind: Option<bool>
    ) -> Result<IssueAssetResult> { ... }
fn reissue_asset(
        &self,
        asset: AssetId,
        asset_amount: Amount
    ) -> Result<ReissueAssetResult> { ... }
fn raw_issue_asset<R: RawTx>(
        &self,
        raw_tx: R,
        issuances: &[RawIssuanceDetails]
    ) -> Result<IssueAssetResult> { ... }
fn raw_reissue_asset<R: RawTx>(
        &self,
        raw_tx: R,
        issuances: &[RawReissuanceDetails]
    ) -> Result<RawReissueAssetResult> { ... }
fn dump_asset_labels(&self) -> Result<HashMap<String, AssetId>> { ... }
fn destroy_amount(
        &self,
        asset: AssetId,
        amount: Amount,
        comment: Option<&str>
    ) -> Result<Hash> { ... }
fn blind_raw_transaction<R: RawTx, B: AsRef<[u8]>>(
        &self,
        raw_tx: R,
        ignore_blind_fail: Option<bool>,
        asset_commitments: Option<&[B]>,
        blind_issuances: Option<bool>
    ) -> Result<Transaction> { ... }
fn unblind_raw_transaction<R: RawTx>(
        &self,
        raw_tx: R
    ) -> Result<UnblindRawTransactionResult> { ... }
fn raw_blind_raw_transaction<R: RawTx, B: AsRef<[u8]>>(
        &self,
        raw_tx: R,
        input_amount_blinding_factors: &[B],
        input_amounts: &[Amount],
        input_assets: &[AssetId],
        input_asset_blinding_factors: &[B],
        ignore_blind_fail: Option<bool>
    ) -> Result<Transaction> { ... }
fn create_blinded_address(
        &self,
        address: &str,
        blinding_pubkey: &PublicKey
    ) -> Result<String> { ... }
fn dump_blinding_key(&self, address: &str) -> Result<SecretKey> { ... }
fn import_blinding_key(
        &self,
        address: &str,
        blinding_key: &SecretKey
    ) -> Result<()> { ... }
fn dump_master_blinding_key(&self) -> Result<SecretKey> { ... }
fn import_master_blinding_key(
        &self,
        master_blinding_key: &SecretKey
    ) -> Result<()> { ... }
fn dump_issuance_blinding_key(
        &self,
        txid: &Hash,
        vin: u32
    ) -> Result<SecretKey> { ... }
fn import_issuance_blinding_key(
        &self,
        txid: &Hash,
        vin: u32,
        blinding_key: &SecretKey
    ) -> Result<()> { ... }
fn get_new_block(&self, min_tx_age_secs: Option<usize>) -> Result<Block> { ... }
fn sign_block(&self, block: &Block) -> Result<Vec<SignedBlockSignature>> { ... }
fn combine_block_signatures(
        &self,
        block: &Block,
        signatures: &[SignedBlockSignature]
    ) -> Result<CombineBlockSigsResult> { ... }
fn test_proposed_block(
        &self,
        block: &Block,
        accept_non_standard: Option<bool>
    ) -> Result<()> { ... }
fn submit_block(&self, block: &Block) -> Result<String> { ... } }

Trait implementing the Liquid RPC commands.

Required methods

fn call<T: for<'a> Deserialize<'a>>(
    &self,
    cmd: &str,
    args: &[Value]
) -> Result<T>

Loading content...

Provided methods

fn get_block_header_raw(&self, hash: &Hash) -> Result<BlockHeader>

fn get_block_header_verbose(&self, hash: &Hash) -> Result<GetBlockHeaderResult>

fn get_blockchain_info(&self) -> Result<GetBlockchainInfoResult>

Returns a data structure containing various state info regarding blockchain processing.

fn get_raw_transaction(
    &self,
    txid: &Hash,
    block_hash: Option<&Hash>
) -> Result<Transaction>

fn get_raw_transaction_verbose(
    &self,
    txid: &Hash,
    block_hash: Option<&Hash>
) -> Result<GetRawTransactionResult>

fn send_to_address(
    &self,
    address: &str,
    amount: f64,
    comment: Option<&str>,
    comment_to: Option<&str>,
    substract_fee: Option<bool>,
    replaceable: Option<bool>,
    confirmation_target: Option<u32>,
    estimate_mode: Option<EstimateMode>,
    asset_label: Option<&str>,
    ignore_blind_fail: Option<bool>
) -> Result<Hash>

fn create_raw_transaction_hex(
    &self,
    utxos: &[CreateRawTransactionInput],
    outs: &HashMap<String, f64>,
    locktime: Option<i64>,
    replaceable: Option<bool>,
    assets: Option<&HashMap<String, AssetId>>
) -> Result<String>

fn create_raw_transaction(
    &self,
    utxos: &[CreateRawTransactionInput],
    outs: &HashMap<String, f64>,
    locktime: Option<i64>,
    replaceable: Option<bool>,
    assets: Option<&HashMap<String, AssetId>>
) -> Result<Transaction>

fn fund_raw_transaction<R: RawTx>(
    &self,
    tx: R,
    options: Option<&FundRawTransactionOptions>,
    is_witness: Option<bool>
) -> Result<FundRawTransactionResult>

fn sign_raw_transaction_with_wallet<R: RawTx>(
    &self,
    tx: R,
    utxos: Option<&[SignRawTransactionInput]>,
    sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>

fn sign_raw_transaction_with_key<R: RawTx>(
    &self,
    tx: R,
    privkeys: &[PrivateKey],
    prevtxs: Option<&[SignRawTransactionInput]>,
    sighash_type: Option<SigHashType>
) -> Result<SignRawTransactionResult>

We use [bitcoin::PrivateKey] because the keys need to be WIF-encoded. Use [bitcoin::Network::Bitcoin] for Liquid and [bitcoin::Network::Regtest] for Elements Regtest.

fn send_raw_transaction<R: RawTx>(&self, tx: R) -> Result<Hash>

fn list_unspent(
    &self,
    minconf: Option<usize>,
    maxconf: Option<usize>,
    addresses: Option<&[&str]>,
    include_unsafe: Option<bool>,
    query_options: Option<&ListUnspentQueryOptions>
) -> Result<Vec<ListUnspentResultEntry>>

fn list_transactions(
    &self,
    count: Option<usize>,
    skip: Option<usize>,
    include_watch_only: Option<bool>
) -> Result<Vec<ListTransactionsResultEntry>>

fn list_since_block(
    &self,
    block_hash: Option<&Hash>,
    target_confirmations: Option<u32>,
    include_watch_only: Option<bool>,
    include_removed: Option<bool>
) -> Result<ListSinceBlockResult>

fn get_new_address(
    &self,
    label: Option<&str>,
    address_type: Option<AddressType>
) -> Result<String>

fn get_raw_change_address(
    &self,
    address_type: Option<AddressType>
) -> Result<String>

fn validate_address(&self, address: &str) -> Result<ValidateAddressResult>

fn get_address_info(&self, address: &str) -> Result<GetAddressInfoResult>

fn get_tx_out(
    &self,
    txid: &Hash,
    vout: u32,
    include_mempool: Option<bool>
) -> Result<Option<GetTxOutResult>>

fn get_balance(
    &self,
    min_confirmations: Option<u32>,
    include_watch_only: Option<bool>
) -> Result<HashMap<String, Amount>>

fn get_balance_asset(
    &self,
    asset_label: &str,
    min_confirmations: Option<u32>,
    include_watch_only: Option<bool>
) -> Result<Amount>

fn get_unconfirmed_balance(&self) -> Result<HashMap<String, Amount>>

fn get_received_by_address(
    &self,
    address: &str,
    min_confirmations: Option<u32>
) -> Result<HashMap<String, Amount>>

fn get_received_by_address_asset(
    &self,
    address: &str,
    asset_label: &str,
    min_confirmations: Option<u32>
) -> Result<Amount>

fn get_sidechain_info(&self) -> Result<GetSidechainInfoResult>

fn get_pegin_address(&self) -> Result<GetPeginAddressResult>

fn create_raw_pegin<R: RawTx, B: AsRef<[u8]>>(
    &self,
    raw_bitcoin_tx: R,
    txout_proof: B,
    claim_script: Option<&Script>
) -> Result<CreateRawPeginResult>

fn claim_pegin<R: RawTx, B: AsRef<[u8]>>(
    &self,
    raw_bitcoin_tx: R,
    txout_proof: B,
    claim_script: Option<&Script>
) -> Result<Hash>

fn init_pegout_wallet(
    &self,
    bitcoin_descriptor: &ExtendedPubKey,
    bip32_counter: Option<ChildNumber>,
    liquid_pak: Option<&str>
) -> Result<InitPegoutWalletResult>

fn send_to_main_chain(
    &self,
    amount: Amount,
    subtract_fee_from_amount: Option<bool>
) -> Result<SendToMainChainResult>

fn get_wallet_pak_info(&self) -> Result<GetWalletPakInfoResult>

fn get_pak_info(&self) -> Result<GetPakInfoResult>

fn tweak_fedpeg_script(
    &self,
    claim_script: &Script
) -> Result<TweakFedpegScriptResult>

fn list_issuances(
    &self,
    asset: Option<AssetId>
) -> Result<Vec<ListIssuancesResult>>

fn issue_asset(
    &self,
    asset_amount: Amount,
    token_amount: Amount,
    blind: Option<bool>
) -> Result<IssueAssetResult>

fn reissue_asset(
    &self,
    asset: AssetId,
    asset_amount: Amount
) -> Result<ReissueAssetResult>

fn raw_issue_asset<R: RawTx>(
    &self,
    raw_tx: R,
    issuances: &[RawIssuanceDetails]
) -> Result<IssueAssetResult>

fn raw_reissue_asset<R: RawTx>(
    &self,
    raw_tx: R,
    issuances: &[RawReissuanceDetails]
) -> Result<RawReissueAssetResult>

fn dump_asset_labels(&self) -> Result<HashMap<String, AssetId>>

fn destroy_amount(
    &self,
    asset: AssetId,
    amount: Amount,
    comment: Option<&str>
) -> Result<Hash>

fn blind_raw_transaction<R: RawTx, B: AsRef<[u8]>>(
    &self,
    raw_tx: R,
    ignore_blind_fail: Option<bool>,
    asset_commitments: Option<&[B]>,
    blind_issuances: Option<bool>
) -> Result<Transaction>

fn unblind_raw_transaction<R: RawTx>(
    &self,
    raw_tx: R
) -> Result<UnblindRawTransactionResult>

fn raw_blind_raw_transaction<R: RawTx, B: AsRef<[u8]>>(
    &self,
    raw_tx: R,
    input_amount_blinding_factors: &[B],
    input_amounts: &[Amount],
    input_assets: &[AssetId],
    input_asset_blinding_factors: &[B],
    ignore_blind_fail: Option<bool>
) -> Result<Transaction>

fn create_blinded_address(
    &self,
    address: &str,
    blinding_pubkey: &PublicKey
) -> Result<String>

fn dump_blinding_key(&self, address: &str) -> Result<SecretKey>

fn import_blinding_key(
    &self,
    address: &str,
    blinding_key: &SecretKey
) -> Result<()>

fn dump_master_blinding_key(&self) -> Result<SecretKey>

fn import_master_blinding_key(
    &self,
    master_blinding_key: &SecretKey
) -> Result<()>

fn dump_issuance_blinding_key(&self, txid: &Hash, vin: u32) -> Result<SecretKey>

fn import_issuance_blinding_key(
    &self,
    txid: &Hash,
    vin: u32,
    blinding_key: &SecretKey
) -> Result<()>

fn get_new_block(&self, min_tx_age_secs: Option<usize>) -> Result<Block>

fn sign_block(&self, block: &Block) -> Result<Vec<SignedBlockSignature>>

fn combine_block_signatures(
    &self,
    block: &Block,
    signatures: &[SignedBlockSignature]
) -> Result<CombineBlockSigsResult>

fn test_proposed_block(
    &self,
    block: &Block,
    accept_non_standard: Option<bool>
) -> Result<()>

fn submit_block(&self, block: &Block) -> Result<String>

Loading content...

Implementors

impl LiquidRpcApi for Client[src]

Loading content...