chia-agent 9.0.0 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.get_farmed_amount_command = exports.get_transaction_count = exports.get_transaction_count_command = exports.send_transaction_multi = exports.send_transaction_multi_command = exports.send_transaction = exports.send_transaction_command = exports.get_next_address = exports.get_next_address_command = exports.get_transactions = exports.get_transactions_command = exports.get_transaction = exports.get_transaction_command = exports.get_wallet_balance = exports.get_wallet_balance_command = exports.create_new_wallet = exports.create_new_wallet_command = exports.get_wallets = exports.get_wallets_command = exports.get_network_info_of_wallet = exports.get_network_info_command_of_wallet = exports.get_initial_freeze_period_of_wallet = exports.get_initial_freeze_period_command_of_wallet = exports.farm_block = exports.farm_block_command = exports.push_tx = exports.push_tx_command = exports.get_height_info = exports.get_height_info_command = exports.get_sync_status = exports.get_sync_status_command = exports.delete_all_keys = exports.delete_all_keys_command = exports.check_delete_key = exports.check_delete_key_command = exports.delete_key = exports.delete_key_command = exports.add_key = exports.add_key_command = exports.generate_mnemonic = exports.generate_mnemonic_command = exports.get_private_key = exports.get_private_key_command = exports.get_public_keys = exports.get_public_keys_command = exports.get_logged_in_fingerprint = exports.get_logged_in_fingerprint_command = exports.log_in = exports.log_in_command = exports.chia_wallet_service = void 0;
13
13
  exports.did_update_metadata_command = exports.did_update_recovery_ids = exports.did_update_recovery_ids_command = exports.did_get_wallet_name = exports.did_get_wallet_name_command = exports.did_set_wallet_name = exports.did_set_wallet_name_command = exports.cancel_offers = exports.cancel_offers_command = exports.cancel_offer = exports.cancel_offer_command = exports.get_offers_count = exports.get_offers_count_command = exports.get_all_offers = exports.get_all_offers_command = exports.get_offer = exports.get_offer_command = exports.take_offer = exports.take_offer_command = exports.check_offer_validity = exports.check_offer_validity_command = exports.get_offer_summary = exports.get_offer_summary_command = exports.create_offer_for_ids = exports.create_offer_for_ids_command = exports.cat_get_asset_id = exports.cat_get_asset_id_command = exports.cat_spend = exports.cat_spend_command = exports.get_stray_cats = exports.get_stray_cats_command = exports.cat_get_name = exports.cat_get_name_command = exports.cat_asset_id_to_name = exports.cat_asset_id_to_name_command = exports.cat_set_name = exports.cat_set_name_command = exports.get_cat_list = exports.get_cat_list_command = exports.extend_derivation_index = exports.extend_derivation_index_command = exports.get_current_derivation_index = exports.get_current_derivation_index_command = exports.select_coins = exports.select_coins_command = exports.delete_unconfirmed_transactions = exports.delete_unconfirmed_transactions_command = exports.create_signed_transaction = exports.create_signed_transaction_command = exports.get_farmed_amount = void 0;
14
14
  exports.pw_join_pool_command = exports.add_rate_limited_funds = exports.add_rate_limited_funds_command = exports.send_clawback_transaction = exports.send_clawback_transaction_command = exports.rl_set_user_info = exports.rl_set_user_info_command = exports.nft_add_uri = exports.nft_add_uri_command = exports.nft_get_info = exports.nft_get_info_command = exports.nft_transfer_nft = exports.nft_transfer_nft_command = exports.nft_set_nft_status = exports.nft_set_nft_status_command = exports.nft_get_wallets_with_dids = exports.nft_get_wallets_with_dids_command = exports.nft_get_wallet_did = exports.nft_get_wallet_did_command = exports.nft_get_by_did = exports.nft_get_by_did_command = exports.nft_set_nft_did = exports.nft_set_nft_did_command = exports.nft_get_nfts = exports.nft_get_nfts_command = exports.nft_mint_nft = exports.nft_mint_nft_command = exports.did_transfer_did = exports.did_transfer_did_command = exports.did_create_backup_file = exports.did_create_backup_file_command = exports.did_get_current_coin_info = exports.did_get_current_coin_info_command = exports.did_get_information_needed_for_recovery = exports.did_get_information_needed_for_recovery_command = exports.did_create_attest = exports.did_create_attest_command = exports.did_get_metadata = exports.did_get_metadata_command = exports.did_get_recovery_list = exports.did_get_recovery_list_command = exports.did_recovery_spend = exports.did_recovery_spend_command = exports.did_get_did = exports.did_get_did_command = exports.did_get_pubkey = exports.did_get_pubkey_command = exports.did_spend = exports.did_spend_command = exports.did_update_metadata = void 0;
15
- exports.pw_status = exports.pw_status_command = exports.pw_absorb_rewards = exports.pw_absorb_rewards_command = exports.pw_self_pool = exports.pw_self_pool_command = exports.pw_join_pool = void 0;
15
+ exports.dl_delete_mirror = exports.dl_delete_mirror_command = exports.dl_new_mirror = exports.dl_new_mirror_command = exports.dl_get_mirrors = exports.dl_get_mirrors_command = exports.dl_owned_singletons = exports.dl_owned_singletons_command = exports.dl_history = exports.dl_history_command = exports.dl_update_multiple = exports.dl_update_multiple_command = exports.dl_update_root = exports.dl_update_root_command = exports.dl_singletons_by_root = exports.dl_singletons_by_root_command = exports.dl_latest_singleton = exports.dl_latest_singleton_command = exports.dl_stop_tracking = exports.dl_stop_tracking_command = exports.dl_track_new = exports.dl_track_new_command = exports.create_new_dl = exports.create_new_dl_command = exports.pw_status = exports.pw_status_command = exports.pw_absorb_rewards = exports.pw_absorb_rewards_command = exports.pw_self_pool = exports.pw_self_pool_command = exports.pw_join_pool = void 0;
16
16
  exports.chia_wallet_service = "chia_wallet";
17
17
  // # Key management
18
18
  exports.log_in_command = "log_in";
@@ -569,3 +569,87 @@ function pw_status(agent, data) {
569
569
  });
570
570
  }
571
571
  exports.pw_status = pw_status;
572
+ exports.create_new_dl_command = "create_new_dl";
573
+ function create_new_dl(agent, data) {
574
+ return __awaiter(this, void 0, void 0, function* () {
575
+ return agent.sendMessage(exports.chia_wallet_service, exports.create_new_dl_command, data);
576
+ });
577
+ }
578
+ exports.create_new_dl = create_new_dl;
579
+ exports.dl_track_new_command = "dl_track_new";
580
+ function dl_track_new(agent, data) {
581
+ return __awaiter(this, void 0, void 0, function* () {
582
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_track_new_command, data);
583
+ });
584
+ }
585
+ exports.dl_track_new = dl_track_new;
586
+ exports.dl_stop_tracking_command = "dl_stop_tracking";
587
+ function dl_stop_tracking(agent, data) {
588
+ return __awaiter(this, void 0, void 0, function* () {
589
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_stop_tracking_command, data);
590
+ });
591
+ }
592
+ exports.dl_stop_tracking = dl_stop_tracking;
593
+ exports.dl_latest_singleton_command = "dl_latest_singleton";
594
+ function dl_latest_singleton(agent, data) {
595
+ return __awaiter(this, void 0, void 0, function* () {
596
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_latest_singleton_command, data);
597
+ });
598
+ }
599
+ exports.dl_latest_singleton = dl_latest_singleton;
600
+ exports.dl_singletons_by_root_command = "dl_singletons_by_root";
601
+ function dl_singletons_by_root(agent, data) {
602
+ return __awaiter(this, void 0, void 0, function* () {
603
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_singletons_by_root_command, data);
604
+ });
605
+ }
606
+ exports.dl_singletons_by_root = dl_singletons_by_root;
607
+ exports.dl_update_root_command = "dl_update_root";
608
+ function dl_update_root(agent, data) {
609
+ return __awaiter(this, void 0, void 0, function* () {
610
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_update_root_command, data);
611
+ });
612
+ }
613
+ exports.dl_update_root = dl_update_root;
614
+ exports.dl_update_multiple_command = "dl_update_multiple";
615
+ function dl_update_multiple(agent, data) {
616
+ return __awaiter(this, void 0, void 0, function* () {
617
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_update_multiple_command, data);
618
+ });
619
+ }
620
+ exports.dl_update_multiple = dl_update_multiple;
621
+ exports.dl_history_command = "dl_history";
622
+ function dl_history(agent, data) {
623
+ return __awaiter(this, void 0, void 0, function* () {
624
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_history_command, data);
625
+ });
626
+ }
627
+ exports.dl_history = dl_history;
628
+ exports.dl_owned_singletons_command = "dl_owned_singletons";
629
+ function dl_owned_singletons(agent) {
630
+ return __awaiter(this, void 0, void 0, function* () {
631
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_owned_singletons_command);
632
+ });
633
+ }
634
+ exports.dl_owned_singletons = dl_owned_singletons;
635
+ exports.dl_get_mirrors_command = "dl_get_mirrors";
636
+ function dl_get_mirrors(agent, data) {
637
+ return __awaiter(this, void 0, void 0, function* () {
638
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_get_mirrors_command, data);
639
+ });
640
+ }
641
+ exports.dl_get_mirrors = dl_get_mirrors;
642
+ exports.dl_new_mirror_command = "dl_new_mirror";
643
+ function dl_new_mirror(agent, data) {
644
+ return __awaiter(this, void 0, void 0, function* () {
645
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_new_mirror_command, data);
646
+ });
647
+ }
648
+ exports.dl_new_mirror = dl_new_mirror;
649
+ exports.dl_delete_mirror_command = "dl_delete_mirror";
650
+ function dl_delete_mirror(agent, data) {
651
+ return __awaiter(this, void 0, void 0, function* () {
652
+ return agent.sendMessage(exports.chia_wallet_service, exports.dl_delete_mirror_command, data);
653
+ });
654
+ }
655
+ exports.dl_delete_mirror = dl_delete_mirror;
@@ -13,9 +13,9 @@ export declare function on_get_connections(daemon: TDaemon, callback: (e: GetMes
13
13
  export declare const state_changed_command_of_wallet = "state_changed";
14
14
  export declare type state_changed_command_of_wallet = typeof state_changed_command_of_wallet;
15
15
  export declare type TStateChangedBroadCastOfWallet = {
16
- state: "add_connection" | "new_block" | "wallet_created" | "added_stray_cat";
16
+ state: "add_connection" | "new_block" | "wallet_created" | "added_stray_cat" | "offer_added" | "offer_cancelled";
17
17
  } | {
18
- state: "coin_removed" | "coin_added" | "pending_transaction";
18
+ state: "coin_removed" | "coin_added" | "pending_transaction" | "did_coin_added" | "nft_coin_added" | "nft_coin_removed" | "nft_coin_updated" | "nft_coin_did_set";
19
19
  wallet_id: uint32;
20
20
  } | {
21
21
  state: "tx_update";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chia-agent",
3
- "version": "9.0.0",
3
+ "version": "9.1.0",
4
4
  "author": "ChiaMineJP <admin@chiamine.jp>",
5
5
  "description": "chia rpc/websocket client library",
6
6
  "license": "MIT",
package/rpc/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { Agent as HttpsAgent } from "https";
3
3
  import { Agent as HttpAgent } from "http";
4
4
  import { TConfig } from "../config/index";
5
5
  import { RpcMessage } from "../api/rpc/index";
6
- declare type TDestination = "farmer" | "harvester" | "full_node" | "wallet" | "daemon" | "pool";
6
+ declare type TDestination = "farmer" | "harvester" | "full_node" | "wallet" | "data_layer" | "daemon" | "pool";
7
7
  export declare function getConnectionInfoFromConfig(destination: TDestination, config: TConfig): {
8
8
  hostname: string;
9
9
  port: number;
@@ -31,6 +31,10 @@ export declare type TRPCAgentProps = {
31
31
  configPath?: string;
32
32
  skip_hostname_verification?: boolean;
33
33
  };
34
+ export declare type ErrorResponse = {
35
+ error: string;
36
+ success: false;
37
+ };
34
38
  export declare class RPCAgent {
35
39
  protected _protocol: "http" | "https";
36
40
  protected _hostname: string;
@@ -47,7 +51,7 @@ export declare class RPCAgent {
47
51
  clientKey: Buffer;
48
52
  caCert: Buffer;
49
53
  };
50
- sendMessage<M extends RpcMessage = RpcMessage>(destination: string, command: string, data?: Record<string, unknown>): Promise<M>;
54
+ sendMessage<M extends RpcMessage = RpcMessage>(destination: string, command: string, data?: Record<string, unknown>): Promise<M | ErrorResponse>;
51
55
  request<R>(method: string, path: string, data?: any): Promise<R>;
52
56
  }
53
57
  export declare type TRPCAgent = InstanceType<typeof RPCAgent>;
package/rpc/index.js CHANGED
@@ -33,6 +33,9 @@ function getConnectionInfoFromConfig(destination, config) {
33
33
  else if (destination === "wallet") {
34
34
  port = +config["/wallet/rpc_port"];
35
35
  }
36
+ else if (destination === "data_layer") {
37
+ port = +config["/data_layer/rpc_port"];
38
+ }
36
39
  else if (destination === "pool") {
37
40
  const pool_url = config["/pool/pool_list/0/pool_url"];
38
41
  const regex = /^(https?:\/\/)?([^/:]+):?(\d*)/;