UNPKG

@massalabs/massa-web3

Version:
319 lines 9.37 kB
"use strict"; /* eslint-disable @typescript-eslint/naming-convention */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Connector = void 0; const http_1 = require("./http"); class Connector { client = {}; constructor(url, opts = {}) { this.client = (0, http_1.getHttpRpcClient)(url, opts); } /** * Execute a smart contract in a read only context */ execute_read_only_bytecode = (params) => { return this.client.request('execute_read_only_bytecode', params); }; /** * Call a function of a contract in a read only context */ execute_read_only_call = (params) => { return this.client.request('execute_read_only_call', params); }; /** * To check when your address is selected to stake. */ get_addresses = (params) => { return this.client.request('get_addresses', params); }; /** * Returns the bytecode of the given addresses. */ get_addresses_bytecode = (params) => { return this.client.request('get_addresses_bytecode', params); }; /** * Get blocks */ get_blocks = (params) => { return this.client.request('get_blocks', params); }; /** * Get a block in the blockclique */ get_blockclique_block_by_slot = (params) => { return this.client.request('get_blockclique_block_by_slot', params); }; /** * Get cliques */ get_cliques = () => { return this.client.request('get_cliques', {}); }; /** * Get a data entry both at the latest final and active executed slots for the given addresses. */ get_datastore_entries = (params) => { return this.client.request('get_datastore_entries', params); }; /** * Get transfers for specified slots */ get_slots_transfers = (params) => { return this.client.request('get_slots_transfers', params); }; /** * Get endorsements */ get_endorsements = (params) => { return this.client.request('get_endorsements', params); }; /** * Returns events optionally filtered */ get_filtered_sc_output_event = (params) => { return this.client.request('get_filtered_sc_output_event', params); }; /** * Get graph interval */ get_graph_interval = (params) => { return this.client.request('get_graph_interval', params); }; /** * Get operations */ get_operations = (params) => { return this.client.request('get_operations', params); }; /** * Get stakers */ get_stakers = (params) => { return this.client.request('get_stakers', params); }; /** * Summary of the current state */ get_status = () => { return this.client.request('get_status', {}); }; /** * Add a vec of new secret(private) keys for the node to use to stake */ add_staking_secret_keys = (params) => { return this.client.request('add_staking_secret_keys', params); }; /** * Return hashset of staking addresses */ get_staking_addresses = () => { return this.client.request('get_staking_addresses', {}); }; /** * Returns if slot is available and the price to book the requested gas */ get_deferred_call_quote = (params) => { return this.client.request('get_deferred_call_quote', params); }; /** * Returns information about deferred calls. */ get_deferred_call_info = (params) => { return this.client.request('get_deferred_call_info', params); }; /** * Returns ids of deferred calls for provided slots. */ get_deferred_call_ids_by_slot = (params) => { return this.client.request('get_deferred_call_ids_by_slot', params); }; /** * Add to bootstrap blacklist given IP addresses */ node_add_to_bootstrap_blacklist = (params) => { return this.client.request('node_add_to_bootstrap_blacklist', params); }; /** * Add to bootstrap whitelist given IP addresses */ node_add_to_bootstrap_whitelist = (params) => { return this.client.request('node_add_to_bootstrap_whitelist', params); }; /** * Add to peers whitelist given IP addresses */ node_add_to_peers_whitelist = (params) => { return this.client.request('node_add_to_peers_whitelist', params); }; /** * Ban given ids */ node_ban_by_id = (params) => { return this.client.request('node_ban_by_id', params); }; /** * Ban given IP addresses */ node_ban_by_ip = (params) => { return this.client.request('node_ban_by_ip', params); }; /** * Returns bootstrap blacklist IP addresses */ node_bootstrap_blacklist = () => { return this.client.request('node_bootstrap_blacklist', {}); }; /** * Returns bootstrap whitelist IP addresses */ node_bootstrap_whitelist = () => { return this.client.request('node_bootstrap_whitelist', {}); }; /** * Allow everyone to bootstrap from the node */ node_bootstrap_whitelist_allow_all = () => { return this.client.request('node_bootstrap_whitelist_allow_all', {}); }; /** * Returns peers whitelist IP addresses */ node_peers_whitelist = () => { return this.client.request('node_peers_whitelist', {}); }; /** * Remove from bootstrap blacklist given IP addresses */ node_remove_from_bootstrap_blacklist = (params) => { return this.client.request('node_remove_from_bootstrap_blacklist', params); }; /** * Remove from bootstrap whitelist given IP addresses */ node_remove_from_bootstrap_whitelist = (params) => { return this.client.request('node_remove_from_bootstrap_whitelist', params); }; /** * Remove from peers whitelist given IP addresses */ node_remove_from_peers_whitelist = (params) => { return this.client.request('node_remove_from_peers_whitelist', params); }; /** * Remove from whitelist given IP addresses */ node_remove_from_whitelist = (params) => { return this.client.request('node_remove_from_whitelist', params); }; /** * Remove a vec of addresses used to stake */ remove_staking_addresses = (params) => { return this.client.request('remove_staking_addresses', params); }; /** * Sign message with node’s key */ node_sign_message = (params) => { return this.client.request('node_sign_message', params); }; /** * Gracefully stop the node */ stop_node = () => { return this.client.request('stop_node', {}); }; /** * Unban given ids */ node_unban_by_id = (params) => { return this.client.request('node_unban_by_id', params); }; /** * Unban given IP addresses */ node_unban_by_ip = (params) => { return this.client.request('node_unban_by_ip', params); }; /** * Whitelist given IP addresses */ node_whitelist = (params) => { return this.client.request('node_whitelist', params); }; /** * Adds operations to pool */ send_operations = (params) => { return this.client.request('send_operations', params); }; /** * Get largest stakers */ get_largest_stakers = (params) => { return this.client.request('get_largest_stakers', params); }; /** * Get next block best parents */ get_next_block_best_parents = () => { return this.client.request('get_next_block_best_parents', {}); }; /** * Get Massa node version */ get_version = () => { return this.client.request('get_version', {}); }; /** * New produced blocks */ subscribe_new_blocks = () => { return this.client.request('subscribe_new_blocks', {}); }; /** * New produced blocks headers */ subscribe_new_blocks_headers = () => { return this.client.request('subscribe_new_blocks_headers', {}); }; /** * New produced blocks with operations content */ subscribe_new_filled_blocks = () => { return this.client.request('subscribe_new_filled_blocks', {}); }; /** * Subscribe to new operations */ subscribe_new_operations = () => { return this.client.request('subscribe_new_operations', {}); }; /** * Unsubscribe from new produced blocks */ unsubscribe_new_blocks = (params) => { return this.client.request('unsubscribe_new_blocks', params); }; /** * Unsubscribe from new produced blocks headers */ unsubscribe_new_blocks_headers = (params) => { return this.client.request('unsubscribe_new_blocks_headers', params); }; /** * Unsubscribe from new produced filled blocks */ unsubscribe_new_filled_blocks = (params) => { return this.client.request('unsubscribe_new_filled_blocks', params); }; /** * Unsubscribe from new received operations */ unsubscribe_new_operations = (params) => { return this.client.request('unsubscribe_new_operations', params); }; } exports.Connector = Connector; //# sourceMappingURL=connector.js.map