export declare const DB_MAX_SAFE_INTEGER = 2147483647; export declare const findTxInputsByIds: string; export declare const findTxCollateralsByIds: string; export declare const findTxOutputsByIds: string; export declare const findCollateralOutputsByTxIds: string; export declare const findTip = "\n\tSELECT \n\t\tblock_no,\n\t\thash,\n\t\tslot_no\n\tFROM block\n\tORDER BY block.id DESC\n\tLIMIT 1"; export declare const findBlocksByHashes = "\n\tSELECT\n\t\tblock.hash AS hash,\n\t\tblock.block_no AS block_no,\n\t\tblock.slot_no AS slot_no,\n\t\tblock.epoch_no AS epoch_no,\n\t\tblock.epoch_slot_no AS epoch_slot_no,\n\t\tblock.\"size\" AS \"size\",\n\t\tblock.\"time\" AT TIME ZONE 'UTC' AS \"time\",\n\t\tleader.hash AS slot_leader_hash,\n\t\tpool.\"view\" AS slot_leader_pool,\n\t\tblock.tx_count AS tx_count,\n\t\tblock.vrf_key AS vrf,\n\t\tnext_blk.hash AS next_block,\n\t\tprev_blk.hash AS previous_block\n\tFROM block \n\tJOIN slot_leader AS leader ON leader.id = block.slot_leader_id\n\tLEFT JOIN block AS next_blk ON block.id = next_blk.previous_id\n\tLEFT JOIN block AS prev_blk ON block.previous_id = prev_blk.id\n\tLEFT JOIN pool_hash AS pool ON pool.id = leader.pool_hash_id\n\tWHERE block.hash = ANY($1)\n\tORDER BY block.id ASC"; export declare const findBlocksOutputByHashes = "\n\tSELECT\n\t\tSUM(fee) AS fee,\n\t\tSUM(out_sum) AS out_sum,\n\t\tblock.hash AS hash\t\n\tFROM tx\n\tJOIN block ON block.id = tx.block_id\n\tWHERE block.hash = ANY($1)\n\tGROUP BY block.hash, block.id\n\tORDER BY block.id ASC"; export declare const findMultiAssetByTxOut = "\n\tSELECT \n\t\tma_out.quantity AS quantity,\n\t\tma_id.fingerprint AS fingerprint,\n\t\tma_id.\"name\" AS asset_name,\n\t\tma_id.\"policy\" AS policy_id,\n\t\ttx.hash AS tx_id,\n\t\ttx_out.id AS tx_out_id\n\tFROM ma_tx_out AS ma_out\n\tJOIN multi_asset AS ma_id ON ma_out.ident = ma_id.id\n\tJOIN tx_out ON tx_out.id = ma_out.tx_out_id\n\tJOIN tx ON tx_out.tx_id = tx.id\n\tWHERE tx_out.id = ANY($1)\n\tORDER BY ma_out.id ASC"; export declare const findReferenceScriptsById = "\n\tSELECT \n\t\ttype AS type,\n\t\tbytes AS bytes,\n\t\tserialised_size AS serialized_size,\n\t\tjson\n\tFROM script AS script\n\tWHERE id = ANY($1)"; export declare const findTxMintByIds = "\n\tSELECT \n\t\tmint.quantity AS quantity,\n\t\tma_id.fingerprint AS fingerprint,\n\t\tma_id.\"name\" AS asset_name,\n\t\tma_id.\"policy\" AS policy_id,\n\t\ttx.hash AS tx_id\n\tFROM ma_tx_mint AS mint\n\tJOIN multi_asset AS ma_id ON mint.ident = ma_id.id\n\tJOIN tx ON tx.id = mint.tx_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY mint.id ASC"; export declare const findTransactionsByIds = "\n\tSELECT \n\t\ttx.hash AS id,\n\t\ttx.block_index AS \"index\",\n\t\ttx.\"size\" AS \"size\",\n\t\ttx.fee AS fee,\n\t\ttx.invalid_before AS invalid_before,\n\t\ttx.invalid_hereafter AS invalid_hereafter,\n\t\ttx.valid_contract AS valid_contract,\n\t\tblock.block_no AS block_no,\n\t\tblock.hash AS block_hash,\n\t\tblock.slot_no AS block_slot_no\n\tFROM tx\n\tJOIN block ON tx.block_id = block.id\n WHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findTxRecordIdsByTxHashes = "\n\tSELECT id FROM tx WHERE hash = ANY($1)\t\n"; export declare const findWithdrawalsByTxIds = "\n\tSELECT\n\t\twithdrawal.amount AS quantity,\n\t\ttx.hash AS tx_id,\n\t\tstk_addr.\"view\" AS stake_address\n\tFROM withdrawal\n\tJOIN tx ON tx.id = withdrawal.tx_id\n\tJOIN stake_address AS stk_addr ON stk_addr.id = withdrawal.addr_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY withdrawal.id ASC"; export declare const findRedeemersByTxIds = "\n\tSELECT\n\t\tredeemer.id AS id,\n\t\tredeemer.\"index\" AS \"index\",\n\t\tredeemer.purpose AS purpose,\n\t\tredeemer.script_hash AS script_hash,\n\t\tredeemer.unit_mem AS unit_mem,\n\t\tredeemer.unit_steps AS unit_steps,\n\t\ttx.hash AS tx_id\n\tFROM redeemer\n\tJOIN tx ON tx.id = redeemer.tx_id\n\tWHERE tx.id = ANY($1)"; export declare const findVotingProceduresByTxIds = "\n\tSELECT\n\t\ttx.hash AS tx_id,\n\t\tvoter_role,\n\t\tch.raw AS committee_voter,\n\t\tch.has_script AS committee_has_script,\n\t\tdh.raw AS drep_voter,\n\t\tdh.has_script AS drep_has_script,\n\t\tph.hash_raw as pool_voter,\n\t\ttx2.hash AS governance_action_tx_id,\n\t\tga.index::INTEGER AS governance_action_index,\n\t\tCASE\n\t\t\tWHEN vote = 'No' THEN 0\n\t\t\tWHEN vote = 'Yes' THEN 1\n\t\t\tWHEN vote = 'Abstain' THEN 2\n\t\tEND AS vote,\n\t\tva.url,\n\t\tva.data_hash\n\tFROM tx\n\tJOIN voting_procedure AS vp ON vp.tx_id = tx.id\n\tJOIN gov_action_proposal AS ga ON gov_action_proposal_id = ga.id\n\tJOIN tx AS tx2 ON ga.tx_id = tx2.id\n\tLEFT JOIN drep_hash AS dh ON drep_voter = dh.id\n\tLEFT JOIN pool_hash AS ph ON pool_voter = ph.id\n\tLEFT JOIN voting_anchor AS va ON vp.voting_anchor_id = va.id\n\tLEFT JOIN committee_hash AS ch ON ch.id = committee_voter\n\tWHERE tx.id = ANY($1)\n\tORDER BY vp.index"; export declare const findProposalProceduresByTxIds = "\n\tSELECT\n\t\ttx.hash AS tx_id,\n\t\tga.deposit,\n\t\tga.description,\n\t\tva.url,\n\t\tva.data_hash,\n\t\tsa.view\n\tFROM tx\n\tJOIN gov_action_proposal AS ga ON tx.id = ga.tx_id\n\tJOIN voting_anchor AS va ON voting_anchor_id = va.id\n\tJOIN stake_address AS sa ON ga.return_address = sa.id\n\tWHERE tx.id = ANY($1)\n\tORDER BY ga.index"; export declare const findPoolRetireCertsTxIds = "\n\tSELECT\n\t\tcert.cert_index AS cert_index,\n\t\tcert.retiring_epoch AS retiring_epoch,\n\t\tpool.\"view\" AS pool_id,\n\t\ttx.hash AS tx_id\n\tFROM tx\n\tJOIN pool_retire AS cert ON cert.announced_tx_id = tx.id\n\tJOIN pool_hash AS pool ON pool.id = cert.hash_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findPoolRegisterCertsByTxIds = "\n\tSELECT\n\t\tcert.cert_index AS cert_index,\n\t\tpool.view AS pool_id,\n\t\ttx.hash AS tx_id,\n\t\tCASE\n\t\t\tWHEN cert.deposit IS NULL THEN '0'\n\t\t\tELSE cert.deposit\n\t\tEND AS deposit,\n\t\tstake_address.view AS reward_account,\n\t\tpledge,\n\t\tfixed_cost,\n\t\tmargin,\n\t\tvrf_key_hash\n\tFROM tx\n\tJOIN pool_update AS cert ON cert.registered_tx_id = tx.id\n\tJOIN pool_hash AS pool ON pool.id = cert.hash_id\n\tJOIN stake_address ON stake_address.id = reward_addr_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findMirCertsByTxIds = "\n\t(SELECT\n\t\tcert.cert_index AS cert_index,\n\t\tcert.amount AS amount,\n\t\t'reserve' AS pot,\n\t\taddr.\"view\" AS address,\n\t\ttx.hash AS tx_id\n\tFROM tx\n\tJOIN reserve AS cert ON cert.tx_id = tx.id\n\tJOIN stake_address AS addr ON cert.addr_id = addr.id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC)\n\tUNION\n\t(SELECT\n\t\tcert.cert_index AS cert_index,\n\t\tcert.amount AS amount,\n\t\t'treasury' AS pot,\n\t\taddr.\"view\" AS address,\n\t\ttx.hash AS tx_id\n\tFROM tx\n\tJOIN treasury AS cert ON cert.tx_id = tx.id\n\tJOIN stake_address AS addr ON cert.addr_id = addr.id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC)"; export declare const findStakeCertsByTxIds = "\n\t(SELECT \n\t\tcert.cert_index AS cert_index,\n\t\taddr.\"view\" AS address,\n\t\tTRUE AS registration,\n\t\ttx.hash AS tx_id,\n\t\tcert.deposit AS deposit\n\tFROM tx\n\tJOIN stake_registration AS cert ON cert.tx_id = tx.id\n\tJOIN stake_address AS addr ON addr.id = cert.addr_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC)\n\tUNION\n\t(SELECT \n\t\tcert.cert_index AS cert_index,\n\t\taddr.\"view\" AS address,\n\t\tFALSE AS registration,\n\t\ttx.hash AS tx_id,\n\t\t(SELECT sr.deposit FROM stake_registration AS sr\n\t\t\tWHERE sr.addr_id = cert.addr_id\n\t\t\t\tAND sr.tx_id < tx.id\n\t\t\tORDER BY sr.tx_id DESC\n\t\t\tLIMIT 1\n\t\t) AS deposit\n\tFROM tx\n\tJOIN stake_deregistration AS cert ON cert.tx_id = tx.id\n\tJOIN stake_address AS addr ON addr.id = cert.addr_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC)"; export declare const findDelegationCertsByTxIds = "\n\tSELECT \n\t\tcert.cert_index AS cert_index,\n\t\ttx.hash AS tx_id,\n\t\tpool.\"view\" AS pool_id,\n\t\taddr.\"view\" AS address\n\tFROM tx\n\tJOIN delegation AS cert ON cert.tx_id = tx.id\n\tJOIN pool_hash AS pool ON pool.id = cert.pool_hash_id\n\tJOIN stake_address AS addr ON addr.id = cert.addr_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findDrepCertsByTxIds = "\n\tSELECT\n\t\tcert_index,\n\t\ttx.hash AS tx_id,\n\t\thas_script,\n\t\tdrep.raw AS drep_hash,\n\t\turl,\n\t\tdata_hash,\n\t\tcert.deposit\n\tFROM tx\n\tJOIN drep_registration AS cert ON cert.tx_id = tx.id\n\tJOIN drep_hash AS drep ON drep.id = cert.drep_hash_id\n\tLEFT JOIN voting_anchor AS anchor ON anchor.id = voting_anchor_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findVoteDelegationCertsByTxIds = "\n\tSELECT\n\t\tcert_index,\n\t\ttx.hash AS tx_id,\n\t\thas_script,\n\t\tdrep.raw AS drep_hash,\n\t\tdrep.view AS drep_view,\n\t\taddr.view AS address\n\tFROM tx\n\tJOIN delegation_vote AS cert ON cert.tx_id = tx.id\n\tJOIN drep_hash AS drep ON drep.id = cert.drep_hash_id\n\tJOIN stake_address AS addr ON addr.id = cert.addr_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findCommitteeRegistrationByTxIds = "\n\tSELECT\n\t\tcert_index,\n\t\ttx.hash AS tx_id,\n\t\tch1.raw AS cold_key,\n\t\tch1.has_script AS cold_key_has_script,\n\t\tch2.raw AS hot_key,\n\t\tch2.has_script AS hot_key_has_script\n\tFROM tx\n\tJOIN committee_registration AS cert ON cert.tx_id = tx.id\n\tJOIN committee_hash AS ch1 ON cold_key_id = ch1.id\n\tJOIN committee_hash AS ch2 ON hot_key_id = ch2.id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findCommitteeResignByTxIds = "\n\tSELECT\n\t\tcert_index,\n\t\ttx.hash AS tx_id,\n\t\tch.raw AS cold_key,\n\t\tch.has_script AS cold_key_has_script,\n\t\turl,\n\t\tdata_hash\n\tFROM tx\n\tJOIN committee_de_registration AS cert ON cert.tx_id = tx.id\n\tJOIN committee_hash AS ch ON cold_key_id = ch.id\n\tLEFT JOIN voting_anchor AS anchor ON anchor.id = voting_anchor_id\n\tWHERE tx.id = ANY($1)\n\tORDER BY tx.id ASC"; export declare const findTxsByAddresses: { readonly ORDER: "\nORDER BY tx_id"; readonly SELECT: "\nSELECT\n DISTINCT tx_id"; readonly WITH: "\nWITH source AS (\n SELECT tx_id, tx_in_id FROM tx_out\n LEFT JOIN tx_in ON tx_out_id = tx_id AND tx_out_index = index\n WHERE address = ANY($1)\n),\ncombined AS (\n SELECT tx_id FROM source\n UNION ALL\n SELECT tx_in_id AS tx_id FROM source WHERE tx_in_id IS NOT NULL\n)"; readonly withRange: { readonly FROM: "\nFROM partial\nJOIN tx ON\n tx.id = tx_id\nJOIN block ON\n block.id = block_id AND\n block_no BETWEEN $2 AND $3"; readonly WITH: ",\npartial AS (\n SELECT\n DISTINCT tx_id\n FROM combined\n)"; }; readonly withoutRange: { readonly FROM: "\nFROM combined"; readonly WITH: ""; }; }; //# sourceMappingURL=queries.d.ts.map