crate::ix!();
lazy_static!{
}
lazy_static!{
}
pub struct UniValueType {
type_any: bool,
ty: uni_value::VType,
}
impl Default for UniValueType {
fn default() -> Self {
todo!();
}
}
impl From<uni_value::VType> for UniValueType {
fn from(ty: uni_value::VType) -> Self {
todo!();
}
}
pub type RPCArgList = Vec<(String,UniValue)>;
pub enum OuterType {
ARR,
OBJ,
NONE,
}
pub struct RPCArg {
names: String,
ty: rpc_arg::Type,
hidden: bool,
inner: Vec<RPCArg>,
fallback: rpc_arg::Fallback,
description: String,
oneline_description: String,
type_str: Vec<String>,
}
pub mod rpc_arg {
use super::*;
pub enum Fallback {
Optional(Optional),
DefaultHint(String),
Default(UniValue)
}
pub enum Type {
OBJ,
ARR,
STR,
NUM,
BOOL,
OBJ_USER_KEYS,
AMOUNT,
STR_HEX,
RANGE,
}
pub enum Optional {
NO,
OMITTED_NAMED_ARG,
OMITTED,
}
}
impl RPCArg {
pub fn new(
name: String,
ty: rpc_arg::Type,
fallback: rpc_arg::Fallback,
description: String,
oneline_description: Option<&str>,
type_str: Vec<String>,
hidden: Option<bool>) -> Self {
let oneline_description: &str =
oneline_description.unwrap_or("");
let hidden: bool = hidden.unwrap_or(false);
todo!();
}
pub fn new_with_inner(
name: String,
ty: rpc_arg::Type,
fallback: rpc_arg::Fallback,
description: String,
inner: Vec<RPCArg>,
oneline_description: Option<&str>,
type_str: Vec<String>) -> Self {
let oneline_description: &str =
oneline_description.unwrap_or("");
todo!();
}
}
pub struct RPCResult {
ty: rpc_arg::Type,
key_name: String,
inner: Vec<RPCResult>,
optional: bool,
description: String,
cond: String,
}
pub mod rpc_result {
pub enum Type {
OBJ,
ARR,
STR,
NUM,
BOOL,
NONE,
ANY,
STR_AMOUNT,
STR_HEX,
OBJ_DYN,
ARR_FIXED,
NUM_TIME,
ELISION,
}
}
impl RPCResult {
pub fn new_with_cond_and_optional(
cond: String,
ty: rpc_arg::Type,
key_name: String,
optional: bool,
description: String,
inner: Vec<RPCResult>) -> Self {
todo!();
}
pub fn new_with_cond(
cond: String,
ty: rpc_arg::Type,
key_name: String,
description: String,
inner: Vec<RPCResult>) -> Self {
todo!();
}
fn new_impl(
ty: rpc_arg::Type,
key_name: String,
optional: bool,
description: String,
inner: Vec<RPCResult>) -> Self {
todo!();
}
pub fn new_with_keyname_description_and_rpc_result_vector(
ty: rpc_arg::Type,
key_name: String,
description: String,
inner: Vec<RPCResult>) -> Self {
todo!();
}
}
pub struct RPCResults {
results: Vec<RPCResult>,
}
impl From<RPCResult> for RPCResults {
fn from(result: RPCResult) -> Self {
todo!();
}
}
impl From<&[RPCResult]> for RPCResults {
fn from(results: &[RPCResult]) -> Self {
todo!();
}
}
pub struct RPCExamples {
examples: String,
}
impl From<String> for RPCExamples {
fn from(examples: String) -> Self {
todo!();
}
}
pub struct RPCHelpMan {
name: String,
fun: rpc_help_man::RPCMethodImpl,
description: String,
args: Vec<RPCArg>,
results: RPCResults,
examples: RPCExamples,
}
pub mod rpc_help_man {
use super::*;
pub type RPCMethodImpl = fn(_0: &RPCHelpMan, _1: &JSONRPCRequest) -> UniValue;
}
pub const UNIX_EPOCH_TIME: &'static str = "UNIX epoch time";
pub const EXAMPLE_ADDRESS: [&'static str; 2] = [
"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl",
"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3"
];
pub fn rpc_type_check(
params: &UniValue,
types_expected: &LinkedList<UniValueType>,
allow_null: Option<bool>) {
let allow_null: bool = allow_null.unwrap_or(false);
todo!();
}
pub fn rpc_type_check_argument(
value: &UniValue,
type_expected: &UniValueType) {
todo!();
}
pub fn rpc_type_check_obj(
o: &UniValue,
types_expected: &HashMap<String,UniValueType>,
allow_null: Option<bool>,
strict: Option<bool>) {
let allow_null: bool = allow_null.unwrap_or(false);
let strict: bool = strict.unwrap_or(false);
todo!();
}
pub fn amount_from_value(
value: &UniValue,
decimals: Option<i32>) -> Amount {
let decimals: i32 = decimals.unwrap_or(8);
todo!();
}
pub fn parse_hashv(
v: &UniValue,
str_name: String) -> u256 {
todo!();
}
pub fn parse_hasho(
o: &UniValue,
str_key: String) -> u256 {
todo!();
}
pub fn parse_hexv(
v: &UniValue,
str_name: String) -> Vec<u8> {
todo!();
}
pub fn parse_hexo(
o: &UniValue,
str_key: String) -> Vec<u8> {
todo!();
}
pub fn shell_quote(s: &String) -> String {
todo!();
}
pub fn shell_quote_if_needed(s: &String) -> String {
todo!();
}
pub fn help_example_cli(
methodname: &String,
args: &String) -> String {
todo!();
}
pub fn help_example_cli_named(
methodname: &String,
args: &RPCArgList) -> String {
todo!();
}
pub fn help_example_rpc(
methodname: &String,
args: &String) -> String {
todo!();
}
pub fn help_example_rpc_named(
methodname: &String,
args: &RPCArgList) -> String {
todo!();
}
pub fn hex_to_pub_key(hex_in: &String) -> PubKey {
todo!();
}
pub fn addr_to_pub_key<T>(
keystore: &FillableSigningProvider<T>,
addr_in: &String) -> PubKey {
todo!();
}
pub fn add_and_get_multisig_destination<T>(
required: i32,
pubkeys: &Vec<PubKey>,
ty: OutputType,
keystore: &mut FillableSigningProvider<T>,
script_out: &mut Script) -> TxDestination {
todo!();
}
#[derive(Default)]
pub struct DescribeAddressVisitor {
}
impl DescribeAddressVisitor {
pub fn invoke_with_nodestination(&self, dest: &NoDestination) -> UniValue {
todo!();
}
pub fn invoke_with_pkhash(&self, keyid: &PKHash) -> UniValue {
todo!();
}
pub fn invoke_with_scripthash(&self, scriptid: &ScriptHash) -> UniValue {
todo!();
}
pub fn invoke_with_witnessv0_keyhash(&self, id: &WitnessV0KeyHash) -> UniValue {
todo!();
}
pub fn invoke_with_witnessv0_scripthash(&self, id: &WitnessV0ScriptHash) -> UniValue {
todo!();
}
pub fn invoke_with_witnessv1_taproo(&self, tap: &WitnessV1Taproot) -> UniValue {
todo!();
}
pub fn invoke_with_witnessunknown(&self, id: &WitnessUnknown) -> UniValue {
todo!();
}
}
pub fn describe_address(dest: &TxDestination) -> UniValue {
todo!();
}
pub fn parse_confirm_target(
value: &UniValue,
max_target: u32) -> u32 {
todo!();
}
pub fn rpc_error_from_transaction_error(terr: TransactionError) -> RPCErrorCode {
todo!();
}
pub fn jsonrpc_transaction_error(
terr: TransactionError,
err_string: Option<&str>) -> UniValue {
let err_string: &str = err_string.unwrap_or("");
todo!();
}
pub struct Section {
left: String,
right: String,
}
impl Section {
pub fn new(
left: &String,
right: &String) -> Self {
todo!();
}
}
pub struct Sections {
sections: Vec<Section>,
max_pad: usize, }
impl Sections {
pub fn push_section(&mut self, s: &Section) {
todo!();
}
pub fn push(&mut self,
arg: &RPCArg,
current_indent: Option<usize>,
outer_type: Option<OuterType>) {
let current_indent: usize = current_indent.unwrap_or(5);
let outer_type: OuterType = outer_type.unwrap_or(OuterType::NONE);
todo!();
}
pub fn to_string(&self) -> String {
todo!();
}
}
impl RPCHelpMan {
pub fn new(
name: String,
description: String,
args: Vec<RPCArg>,
results: RPCResults,
examples: RPCExamples) -> Self {
todo!();
}
pub fn new_with_fun(
name: String,
description: String,
args: Vec<RPCArg>,
results: RPCResults,
examples: RPCExamples,
fun: rpc_help_man::RPCMethodImpl) -> Self {
todo!();
}
}
impl ToDescriptionString for RPCResults {
fn to_description_string(&self) -> String {
todo!();
}
}
impl ToDescriptionString for RPCExamples {
fn to_description_string(&self) -> String {
todo!();
}
}
impl RPCHelpMan {
pub fn handle_request(&self, request: &JSONRPCRequest) -> UniValue {
todo!();
}
pub fn is_valid_num_args(&self, num_args: usize) -> bool {
todo!();
}
pub fn get_arg_names(&self) -> Vec<String> {
todo!();
}
pub fn to_string(&self) -> String {
todo!();
}
pub fn get_arg_map(&self) -> UniValue {
todo!();
}
}
impl RPCArg {
pub fn get_first_name(&self) -> String {
todo!();
}
pub fn get_name(&self) -> String {
todo!();
}
pub fn is_optional(&self) -> bool {
todo!();
}
}
pub trait ToDescriptionString {
fn to_description_string(&self) -> String;
}
impl ToDescriptionString for RPCArg {
fn to_description_string(&self) -> String {
todo!();
}
}
impl RPCResult {
pub fn to_sections(&self,
sections: &mut Sections,
outer_type: Option<OuterType>,
current_indent: Option<i32>) {
let outer_type: OuterType = outer_type.unwrap_or(OuterType::NONE);
let current_indent: i32 = current_indent.unwrap_or(0);
todo!();
}
pub fn matches_type(&self, result: &UniValue) -> bool {
todo!();
}
}
impl RPCArg {
pub fn to_string_obj(&self, oneline: bool) -> String {
todo!();
}
pub fn to_string(&self, oneline: bool) -> String {
todo!();
}
}
pub fn parse_range(value: &UniValue) -> (i64,i64) {
todo!();
}
pub fn parse_descriptor_range(value: &UniValue) -> (i64,i64) {
todo!();
}
pub fn eval_descriptor_string_or_object(
scanobject: &UniValue,
provider: &mut FlatSigningProvider) -> Vec<Script> {
todo!();
}
pub fn get_services_names(services: ServiceFlags) -> UniValue {
todo!();
}