UNPKG

chia-agent

Version:
451 lines (450 loc) 23.6 kB
import { TRPCAgent } from "../../../rpc/index"; import { bool, bytes, None, Optional, str } from "../../chia/types/_python_types_"; import { int, uint64 } from "../../chia_rs/wheel/python/sized_ints"; import { TransactionRecord } from "../../chia/wallet/transaction_record"; import { bytes32 } from "../../chia_rs/wheel/python/sized_bytes"; import { DLProof, OfferMarshalled, OfferStoreMarshalled, PluginStatusMarshalled, RootMarshalled, SyncStatus, VerifyProofResponse } from "../../chia/data_layer/data_layer_util"; import { GetMessageType, ResType } from "../../types"; import { TDaemon } from "../../../daemon/index"; export declare const chia_data_layer_service = "chia_data_layer"; export type chia_data_layer_service = typeof chia_data_layer_service; export declare const wallet_log_in_command = "wallet_log_in"; export type wallet_log_in_command = typeof wallet_log_in_command; export type TWalletLogInRequest = { fingerprint: int; }; export type TWalletLogInResponse = Record<string, never>; export type WsWalletLogInMessage = GetMessageType<chia_data_layer_service, wallet_log_in_command, TWalletLogInResponse>; export declare function wallet_log_in<T extends TRPCAgent | TDaemon>(agent: T, params: TWalletLogInRequest): Promise<ResType<T, TWalletLogInResponse, WsWalletLogInMessage>>; export declare const create_data_store_command = "create_data_store"; export type create_data_store_command = typeof create_data_store_command; export type TCreateDataStoreRequest = { fee?: uint64; verbose?: bool; }; export type TCreateDataStoreResponse = { txs?: TransactionRecord[]; id: str; }; export type WsCreateDataStoreMessage = GetMessageType<chia_data_layer_service, create_data_store_command, TCreateDataStoreResponse>; export declare function create_data_store<T extends TRPCAgent | TDaemon>(agent: T, params: TCreateDataStoreRequest): Promise<ResType<T, TCreateDataStoreResponse, WsCreateDataStoreMessage>>; export declare const get_owned_stores_command = "get_owned_stores"; export type get_owned_stores_command = typeof get_owned_stores_command; export type TGetOwnedStoresResponse = { store_ids: str[]; }; export type WsGetOwnedStoresMessage = GetMessageType<chia_data_layer_service, get_owned_stores_command, TGetOwnedStoresResponse>; export declare function get_owned_stores<T extends TRPCAgent | TDaemon>(agent: T): Promise<ResType<T, TGetOwnedStoresResponse, WsGetOwnedStoresMessage>>; export type BatchUpdateChange = { action: "insert"; key: str; value: str; reference_node_hash?: str; side?: 0 | 1; } | { action: "delete"; key: str; } | { action: "upsert"; key: str; value: str; }; export declare const batch_update_command = "batch_update"; export type batch_update_command = typeof batch_update_command; export type TBatchUpdateRequest = { fee?: uint64; changelist: BatchUpdateChange[]; id: str; submit_on_chain?: bool; }; export type TBatchUpdateResponse = { tx_id?: bytes32; }; export type WsBatchUpdateMessage = GetMessageType<chia_data_layer_service, batch_update_command, TBatchUpdateResponse>; export declare function batch_update<T extends TRPCAgent | TDaemon>(agent: T, params: TBatchUpdateRequest): Promise<ResType<T, TBatchUpdateResponse, WsBatchUpdateMessage>>; export declare const multistore_batch_update_command = "multistore_batch_update"; export type multistore_batch_update_command = typeof multistore_batch_update_command; export type TMultistoreBatchUpdateRequest = { fee?: uint64; store_updates: Array<{ store_id: str; changelist: BatchUpdateChange[]; }>; submit_on_chain?: bool; }; export type TMultistoreBatchUpdateResponse = { tx_id?: bytes32[]; }; export type WsMultistoreBatchUpdateMessage = GetMessageType<chia_data_layer_service, multistore_batch_update_command, TMultistoreBatchUpdateResponse>; export declare function multistore_batch_update<T extends TRPCAgent | TDaemon>(agent: T, params: TMultistoreBatchUpdateRequest): Promise<ResType<T, TMultistoreBatchUpdateResponse, WsMultistoreBatchUpdateMessage>>; export declare const submit_pending_root_command = "submit_pending_root"; export type submit_pending_root_command = typeof submit_pending_root_command; export type TSubmitPendingRootRequest = { id: str; fee?: uint64; }; export type TSubmitPendingRootResponse = { tx_id: bytes32; }; export type WsSubmitPendingRootMessage = GetMessageType<chia_data_layer_service, submit_pending_root_command, TSubmitPendingRootResponse>; export declare function submit_pending_root<T extends TRPCAgent | TDaemon>(agent: T, params: TSubmitPendingRootRequest): Promise<ResType<T, TSubmitPendingRootResponse, WsSubmitPendingRootMessage>>; export declare const submit_all_pending_roots_command = "submit_all_pending_roots"; export type submit_all_pending_roots_command = typeof submit_all_pending_roots_command; export type TSubmitAllPendingRootsRequest = { fee?: uint64; }; export type TSubmitAllPendingRootsResponse = { tx_id: bytes32[]; }; export type WsSubmitAllPendingRootsMessage = GetMessageType<chia_data_layer_service, submit_all_pending_roots_command, TSubmitAllPendingRootsResponse>; export declare function submit_all_pending_roots<T extends TRPCAgent | TDaemon>(agent: T, params: TSubmitAllPendingRootsRequest): Promise<ResType<T, TSubmitAllPendingRootsResponse, WsSubmitAllPendingRootsMessage>>; export declare const get_value_command = "get_value"; export type get_value_command = typeof get_value_command; export type TGetValueRequest = { id: str; key: str; root_hash?: str; }; export type TGetValueResponse = { value: str | None; }; export type WsGetValueMessage = GetMessageType<chia_data_layer_service, get_value_command, TGetValueResponse>; export declare function get_value<T extends TRPCAgent | TDaemon>(agent: T, params: TGetValueRequest): Promise<ResType<T, TGetValueResponse, WsGetValueMessage>>; export declare const get_keys_command = "get_keys"; export type get_keys_command = typeof get_keys_command; export type TGetKeysRequest = { id: str; root_hash?: str; page?: int; max_page_size?: int; }; export type TGetKeysResponse = { keys: str[]; } | { keys: str[]; total_pages: int; total_bytes: int; root_hash: Optional<bytes32>; }; export type WsGetKeysMessage = GetMessageType<chia_data_layer_service, get_keys_command, TGetKeysResponse>; export declare function get_keys<T extends TRPCAgent | TDaemon>(agent: T, params: TGetKeysRequest): Promise<ResType<T, TGetKeysResponse, WsGetKeysMessage>>; export declare const get_keys_values_command = "get_keys_values"; export type get_keys_values_command = typeof get_keys_values_command; export type TGetKeysValuesRequest = { id: str; root_hash?: str; page?: int; max_page_size?: int; }; export type TGetKeysValuesResponse = { keys_values: Array<{ hash: str; key: str; value: str; }>; } | { keys_values: Array<{ hash: str; key: str; value: str; }>; total_pages: int; total_bytes: int; root_hash: Optional<bytes32>; }; export type WsGetKeysValuesMessage = GetMessageType<chia_data_layer_service, get_keys_values_command, TGetKeysValuesResponse>; export declare function get_keys_values<T extends TRPCAgent | TDaemon>(agent: T, params: TGetKeysValuesRequest): Promise<ResType<T, TGetKeysValuesResponse, WsGetKeysValuesMessage>>; export declare const get_ancestors_command = "get_ancestors"; export type get_ancestors_command = typeof get_ancestors_command; export type TGetAncestorsRequest = { id: str; hash: str; }; export type TGetAncestorsResponse = { ancestors: Array<{ hash: bytes32; left_hash: bytes32; right_hash: bytes32; }>; }; export type WsGetAncestorsMessage = GetMessageType<chia_data_layer_service, get_ancestors_command, TGetAncestorsResponse>; export declare function get_ancestors<T extends TRPCAgent | TDaemon>(agent: T, params: TGetAncestorsRequest): Promise<ResType<T, TGetAncestorsResponse, WsGetAncestorsMessage>>; export declare const get_root_command = "get_root"; export type get_root_command = typeof get_root_command; export type TGetRootRequest = { id: str; }; export type TGetRootResponse = { hash: bytes32; confirmed: bool; timestamp: uint64; }; export type WsGetRootMessage = GetMessageType<chia_data_layer_service, get_root_command, TGetRootResponse>; export declare function get_root<T extends TRPCAgent | TDaemon>(agent: T, params: TGetRootRequest): Promise<ResType<T, TGetRootResponse, WsGetRootMessage>>; export declare const get_local_root_command = "get_local_root"; export type get_local_root_command = typeof get_local_root_command; export type TGetLocalRootRequest = { id: str; }; export type TGetLocalRootResponse = { hash: bytes32 | None; }; export type WsGetLocalRootMessage = GetMessageType<chia_data_layer_service, get_local_root_command, TGetLocalRootResponse>; export declare function get_local_root<T extends TRPCAgent | TDaemon>(agent: T, params: TGetLocalRootRequest): Promise<ResType<T, TGetLocalRootResponse, WsGetLocalRootMessage>>; export declare const get_roots_command = "get_roots"; export type get_roots_command = typeof get_roots_command; export type TGetRootsRequest = { ids: str[]; }; export type TGetRootsResponse = { root_hashes: Array<{ id: bytes32; hash: bytes32; confirmed: bool; timestamp: uint64; }>; }; export type WsGetRootsMessage = GetMessageType<chia_data_layer_service, get_roots_command, TGetRootsResponse>; export declare function get_roots<T extends TRPCAgent | TDaemon>(agent: T, params: TGetRootsRequest): Promise<ResType<T, TGetRootsResponse, WsGetRootsMessage>>; export declare const delete_key_command = "delete_key"; export type delete_key_command = typeof delete_key_command; export type TDeleteKeyRequest = { fee?: uint64; key: str; id: str; }; export type TDeleteKeyResponse = { tx_id: bytes32; }; export type WsDeleteKeyMessage = GetMessageType<chia_data_layer_service, delete_key_command, TDeleteKeyResponse>; export declare function delete_key<T extends TRPCAgent | TDaemon>(agent: T, params: TDeleteKeyRequest): Promise<ResType<T, TDeleteKeyResponse, WsDeleteKeyMessage>>; export declare const insert_command = "insert"; export type insert_command = typeof insert_command; export type TInsertRequest = { fee?: uint64; key: str; value: str; id: str; }; export type TInsertResponse = { tx_id: bytes32; }; export type WsInsertMessage = GetMessageType<chia_data_layer_service, insert_command, TInsertResponse>; export declare function insert<T extends TRPCAgent | TDaemon>(agent: T, params: TInsertRequest): Promise<ResType<T, TInsertResponse, WsInsertMessage>>; export declare const subscribe_command = "subscribe"; export type subscribe_command = typeof subscribe_command; export type TSubscribeRequest = { id: str; urls: str[]; }; export type TSubscribeResponse = Record<string, never>; export type WsSubscribeMessage = GetMessageType<chia_data_layer_service, subscribe_command, TSubscribeResponse>; export declare function subscribe<T extends TRPCAgent | TDaemon>(agent: T, params: TSubscribeRequest): Promise<ResType<T, TSubscribeResponse, WsSubscribeMessage>>; export declare const unsubscribe_command = "unsubscribe"; export type unsubscribe_command = typeof unsubscribe_command; export type TUnsubscribeRequest = { id: str; retain?: bool; }; export type TUnsubscribeResponse = Record<string, never>; export type WsUnsubscribeMessage = GetMessageType<chia_data_layer_service, unsubscribe_command, TUnsubscribeResponse>; export declare function unsubscribe<T extends TRPCAgent | TDaemon>(agent: T, params: TUnsubscribeRequest): Promise<ResType<T, TUnsubscribeResponse, WsUnsubscribeMessage>>; export declare const add_mirror_command = "add_mirror"; export type add_mirror_command = typeof add_mirror_command; export type TAddMirrorRequest = { id: str; urls: str[]; amount: uint64; fee?: uint64; }; export type TAddMirrorResponse = Record<string, never>; export type WsAddMirrorMessage = GetMessageType<chia_data_layer_service, add_mirror_command, TAddMirrorResponse>; export declare function add_mirror<T extends TRPCAgent | TDaemon>(agent: T, params: TAddMirrorRequest): Promise<ResType<T, TAddMirrorResponse, WsAddMirrorMessage>>; export declare const delete_mirror_command = "delete_mirror"; export type delete_mirror_command = typeof delete_mirror_command; export type TDeleteMirrorRequest = { coin_id: str; fee?: uint64; }; export type TDeleteMirrorResponse = Record<string, never>; export type WsDeleteMirrorMessage = GetMessageType<chia_data_layer_service, delete_mirror_command, TDeleteMirrorResponse>; export declare function delete_mirror<T extends TRPCAgent | TDaemon>(agent: T, params: TDeleteMirrorRequest): Promise<ResType<T, TDeleteMirrorResponse, WsDeleteMirrorMessage>>; export declare const get_mirrors_command = "get_mirrors"; export type get_mirrors_command = typeof get_mirrors_command; export type TGetMirrorsRequest = { id: str; }; export type TGetMirrorsResponse = { mirrors: Array<{ coin_id: str; launcher_id: str; amount: uint64; urls: str[]; ours: bool; }>; }; export type WsGetMirrorsMessage = GetMessageType<chia_data_layer_service, get_mirrors_command, TGetMirrorsResponse>; export declare function get_mirrors<T extends TRPCAgent | TDaemon>(agent: T, params: TGetMirrorsRequest): Promise<ResType<T, TGetMirrorsResponse, WsGetMirrorsMessage>>; export declare const remove_subscriptions_command = "remove_subscriptions"; export type remove_subscriptions_command = typeof remove_subscriptions_command; export type TRemoveSubscriptionsRequest = { id: str; urls: str[]; }; export type TRemoveSubscriptionsResponse = Record<string, never>; export type WsRemoveSubscriptionsMessage = GetMessageType<chia_data_layer_service, remove_subscriptions_command, TRemoveSubscriptionsResponse>; export declare function remove_subscriptions<T extends TRPCAgent | TDaemon>(agent: T, params: TRemoveSubscriptionsRequest): Promise<ResType<T, TRemoveSubscriptionsResponse, WsRemoveSubscriptionsMessage>>; export declare const subscriptions_command = "subscriptions"; export type subscriptions_command = typeof subscriptions_command; export type TSubscriptionsResponse = { store_ids: str[]; }; export type WsSubscriptionsMessage = GetMessageType<chia_data_layer_service, subscriptions_command, TSubscriptionsResponse>; export declare function subscriptions<T extends TRPCAgent | TDaemon>(agent: T): Promise<ResType<T, TSubscriptionsResponse, WsSubscriptionsMessage>>; export declare const get_kv_diff_command = "get_kv_diff"; export type get_kv_diff_command = typeof get_kv_diff_command; export type TGetKvDiffRequest = { id: str; hash_1: str; hash_2: str; page?: int; max_page_size?: int; }; export type TGetKvDiffResponse = { diff: Array<{ type: str; key: str; value: str; }>; } | { diff: Array<{ type: str; key: str; value: str; }>; total_pages: int; total_bytes: int; }; export type WsGetKvDiffMessage = GetMessageType<chia_data_layer_service, get_kv_diff_command, TGetKvDiffResponse>; export declare function get_kv_diff<T extends TRPCAgent | TDaemon>(agent: T, params: TGetKvDiffRequest): Promise<ResType<T, TGetKvDiffResponse, WsGetKvDiffMessage>>; export declare const get_root_history_command = "get_root_history"; export type get_root_history_command = typeof get_root_history_command; export type TGetRootHistoryRequest = { id: str; }; export type TGetRootHistoryResponse = { root_history: Array<{ root_hash: bytes32; confirmed: bool; timestamp: uint64; }>; }; export type WsGetRootHistoryMessage = GetMessageType<chia_data_layer_service, get_root_history_command, TGetRootHistoryResponse>; export declare function get_root_history<T extends TRPCAgent | TDaemon>(agent: T, params: TGetRootHistoryRequest): Promise<ResType<T, TGetRootHistoryResponse, WsGetRootHistoryMessage>>; export declare const add_missing_files_command = "add_missing_files"; export type add_missing_files_command = typeof add_missing_files_command; export type TAddMissingFilesRequest = { ids?: str[]; overwrite?: bool; foldername?: str; }; export type TAddMissingFilesResponse = Record<string, never>; export type WsAddMissingFilesMessage = GetMessageType<chia_data_layer_service, add_missing_files_command, TAddMissingFilesResponse>; export declare function add_missing_files<T extends TRPCAgent | TDaemon>(agent: T, params: TAddMissingFilesRequest): Promise<ResType<T, TAddMissingFilesResponse, WsAddMissingFilesMessage>>; export declare const make_offer_command = "make_offer"; export type make_offer_command = typeof make_offer_command; export type TMakeOfferRequest = { fee?: uint64; maker: OfferStoreMarshalled; taker: OfferStoreMarshalled; }; export type TMakeOfferResponse = { success: bool; offer: OfferMarshalled; }; export type WsMakeOfferMessage = GetMessageType<chia_data_layer_service, make_offer_command, TMakeOfferResponse>; export declare function make_offer<T extends TRPCAgent | TDaemon>(agent: T, params: TMakeOfferRequest): Promise<ResType<T, TMakeOfferResponse, WsMakeOfferMessage>>; export declare const take_offer_command = "take_offer"; export type take_offer_command = typeof take_offer_command; export type TTakeOfferRequest = { fee?: uint64; offer: OfferMarshalled; }; export type TTakeOfferResponse = { success: bool; trade_id: str; }; export type WsTakeOfferMessage = GetMessageType<chia_data_layer_service, take_offer_command, TTakeOfferResponse>; export declare function take_offer<T extends TRPCAgent | TDaemon>(agent: T, params: TTakeOfferRequest): Promise<ResType<T, TTakeOfferResponse, WsTakeOfferMessage>>; export declare const verify_offer_command = "verify_offer"; export type verify_offer_command = typeof verify_offer_command; export type TVerifyOfferRequest = { fee?: uint64; offer: OfferMarshalled; }; export type TVerifyOfferResponse = { success: bool; valid: bool; error: Optional<str>; fee: Optional<uint64>; }; export type WsVerifyOfferMessage = GetMessageType<chia_data_layer_service, verify_offer_command, TVerifyOfferResponse>; export declare function verify_offer<T extends TRPCAgent | TDaemon>(agent: T, params: TVerifyOfferRequest): Promise<ResType<T, TVerifyOfferResponse, WsVerifyOfferMessage>>; export declare const cancel_offer_command = "cancel_offer"; export type cancel_offer_command = typeof cancel_offer_command; export type TCancelOfferRequest = { trade_id: str; secure: bool; fee?: uint64; }; export type TCancelOfferResponse = { success: bool; }; export type WsCancelOfferMessage = GetMessageType<chia_data_layer_service, cancel_offer_command, TCancelOfferResponse>; export declare function cancel_offer<T extends TRPCAgent | TDaemon>(agent: T, params: TCancelOfferRequest): Promise<ResType<T, TCancelOfferResponse, WsCancelOfferMessage>>; export declare const get_sync_status_command = "get_sync_status"; export type get_sync_status_command = typeof get_sync_status_command; export type TGetSyncStatusRequest = { id: str; }; export type TGetSyncStatusResponse = { sync_status: SyncStatus; }; export type WsGetSyncStatusMessage = GetMessageType<chia_data_layer_service, get_sync_status_command, TGetSyncStatusResponse>; export declare function get_sync_status<T extends TRPCAgent | TDaemon>(agent: T, params: TGetSyncStatusRequest): Promise<ResType<T, TGetSyncStatusResponse, WsGetSyncStatusMessage>>; export declare const check_plugins_command = "check_plugins"; export type check_plugins_command = typeof check_plugins_command; export type TCheckPluginsResponse = PluginStatusMarshalled; export type WsCheckPluginsMessage = GetMessageType<chia_data_layer_service, check_plugins_command, TCheckPluginsResponse>; export declare function check_plugins<T extends TRPCAgent | TDaemon>(agent: T): Promise<ResType<T, PluginStatusMarshalled, WsCheckPluginsMessage>>; export declare const clear_pending_roots_command = "clear_pending_roots"; export type clear_pending_roots_command = typeof clear_pending_roots_command; export type TClearPendingRootsRequest = { store_id: str; }; export type TClearPendingRootsResponse = { success: bool; root: Optional<RootMarshalled>; }; export type WsClearPendingRootsMessage = GetMessageType<chia_data_layer_service, clear_pending_roots_command, TClearPendingRootsResponse>; export declare function clear_pending_roots<T extends TRPCAgent | TDaemon>(agent: T, params: TClearPendingRootsRequest): Promise<ResType<T, TClearPendingRootsResponse, WsClearPendingRootsMessage>>; export declare const get_proof_command = "get_proof"; export type get_proof_command = typeof get_proof_command; export type TGetProofRequest = { store_id: bytes32; keys: bytes[]; }; export type TGetProofResponse = { proof: DLProof; success: bool; }; export type WsGetProofMessage = GetMessageType<chia_data_layer_service, get_proof_command, TGetProofResponse>; export declare function get_proof<T extends TRPCAgent | TDaemon>(agent: T, params: TGetProofRequest): Promise<ResType<T, TGetProofResponse, WsGetProofMessage>>; export declare const verify_proof_command = "verify_proof"; export type verify_proof_command = typeof verify_proof_command; export type TVerifyProofRequest = DLProof; export type TVerifyProofResponse = VerifyProofResponse; export type WsVerifyProofMessage = GetMessageType<chia_data_layer_service, verify_proof_command, TVerifyProofResponse>; export declare function verify_proof<T extends TRPCAgent | TDaemon>(agent: T, params: TVerifyProofRequest): Promise<ResType<T, VerifyProofResponse, WsVerifyProofMessage>>; export type RpcDataLayerMessage = TWalletLogInResponse | TCreateDataStoreResponse | TGetOwnedStoresResponse | TBatchUpdateResponse | TMultistoreBatchUpdateResponse | TSubmitPendingRootResponse | TSubmitAllPendingRootsRequest | TGetValueResponse | TGetKeysResponse | TGetKeysValuesResponse | TGetAncestorsResponse | TGetRootResponse | TGetLocalRootResponse | TGetRootsResponse | TDeleteKeyResponse | TInsertResponse | TSubscribeResponse | TUnsubscribeResponse | TAddMirrorResponse | TDeleteMirrorResponse | TGetMirrorsResponse | TRemoveSubscriptionsResponse | TSubscriptionsResponse | TGetKvDiffResponse | TGetRootHistoryResponse | TAddMissingFilesResponse | TMakeOfferResponse | TTakeOfferResponse | TVerifyOfferResponse | TCancelOfferResponse | TGetSyncStatusResponse | TCheckPluginsResponse | TClearPendingRootsResponse | TGetProofResponse | TVerifyProofResponse; export type RpcDataLayerMessageOnWs = WsWalletLogInMessage | WsCreateDataStoreMessage | WsGetOwnedStoresMessage | WsBatchUpdateMessage | WsMultistoreBatchUpdateMessage | WsSubmitPendingRootMessage | WsSubmitAllPendingRootsMessage | WsGetValueMessage | WsGetKeysMessage | WsGetKeysValuesMessage | WsGetAncestorsMessage | WsGetRootMessage | WsGetLocalRootMessage | WsGetRootsMessage | WsDeleteKeyMessage | WsInsertMessage | WsSubscribeMessage | WsUnsubscribeMessage | WsAddMirrorMessage | WsDeleteMirrorMessage | WsGetMirrorsMessage | WsRemoveSubscriptionsMessage | WsSubscriptionsMessage | WsGetKvDiffMessage | WsGetRootHistoryMessage | WsAddMissingFilesMessage | WsMakeOfferMessage | WsTakeOfferMessage | WsVerifyOfferMessage | WsCancelOfferMessage | WsGetSyncStatusMessage | WsCheckPluginsMessage | WsClearPendingRootsMessage | WsGetProofMessage | WsVerifyProofMessage;