@proton/hyperion
Advanced tools
Comparing version 3.3.3 to 3.4.0
@@ -1,2 +0,2 @@ | ||
export declare const V2_ALIVE = "/v2/state/alive"; | ||
export declare const V2_HEALTH = "/v2/health"; | ||
export declare const V2_GET_KEY_ACCOUNTS = "/v2/state/get_key_accounts"; | ||
@@ -12,4 +12,3 @@ export declare const V2_GET_TOKENS = "/v2/state/get_tokens"; | ||
export declare const V2_GET_DELTAS = "/v2/history/get_deltas"; | ||
export declare const V2_GET_TRANSACTED_ACCOUNTS = "/v2/history/get_transacted_accounts"; | ||
export declare const V2_GET_TABLE_STATE = "/v2/history/get_table_state"; | ||
export declare const V2_GET_TRANSACTION = "/v2/history/get_transaction"; | ||
export declare const V2_GET_TRANSFERS = "/v2/history/get_transfers"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.V2_GET_TRANSFERS = exports.V2_GET_TRANSACTION = exports.V2_GET_TRANSACTED_ACCOUNTS = exports.V2_GET_DELTAS = exports.V2_GET_CREATOR = exports.V2_GET_CREATED_ACCOUNTS = exports.V2_GET_ACTIONS = exports.V2_GET_ABI_SNAPSHOT = exports.V2_GET_PROPOSALS = exports.V2_GET_LINKS = exports.V2_GET_VOTERS = exports.V2_GET_TOKENS = exports.V2_GET_KEY_ACCOUNTS = exports.V2_ALIVE = void 0; | ||
exports.V2_GET_TRANSACTION = exports.V2_GET_TABLE_STATE = exports.V2_GET_DELTAS = exports.V2_GET_CREATOR = exports.V2_GET_CREATED_ACCOUNTS = exports.V2_GET_ACTIONS = exports.V2_GET_ABI_SNAPSHOT = exports.V2_GET_PROPOSALS = exports.V2_GET_LINKS = exports.V2_GET_VOTERS = exports.V2_GET_TOKENS = exports.V2_GET_KEY_ACCOUNTS = exports.V2_HEALTH = void 0; | ||
// State | ||
exports.V2_ALIVE = "/v2/state/alive"; | ||
exports.V2_HEALTH = "/v2/health"; | ||
exports.V2_GET_KEY_ACCOUNTS = "/v2/state/get_key_accounts"; | ||
@@ -17,5 +17,4 @@ exports.V2_GET_TOKENS = "/v2/state/get_tokens"; | ||
exports.V2_GET_DELTAS = "/v2/history/get_deltas"; | ||
exports.V2_GET_TRANSACTED_ACCOUNTS = "/v2/history/get_transacted_accounts"; | ||
exports.V2_GET_TABLE_STATE = "/v2/history/get_table_state"; | ||
exports.V2_GET_TRANSACTION = "/v2/history/get_transaction"; | ||
exports.V2_GET_TRANSFERS = "/v2/history/get_transfers"; | ||
//# sourceMappingURL=endpoints.js.map |
@@ -1,2 +0,4 @@ | ||
import { Alive, GetAbiSnapshot, GetVoters, GetCreatedAccounts, GetDeltas, GetCreator, GetActions, GetKeyAccounts, GetTokens, GetTransactedAccounts, GetTransaction, GetTransfers, GetLinks, GetProposals } from "./types/api"; | ||
import { HealthV2, GetAbiSnapshot, GetVoters, GetCreatedAccounts, GetDeltas, GetTableState, GetCreator, GetActions, GetKeyAccounts, GetTokens, GetTransaction, GetLinks, GetProposals } from "./types/api"; | ||
import 'isomorphic-fetch'; | ||
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'; | ||
/** | ||
@@ -47,3 +49,3 @@ * JsonRpc | ||
*/ | ||
alive(): Promise<Alive>; | ||
alive(): Promise<HealthV2>; | ||
/** | ||
@@ -231,2 +233,19 @@ * [GET /v2/history/get_abi_snapshot](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_abi_snapshot) | ||
/** | ||
* [GET /v2/history/get_table_state](https://eos.hyperion.eosrio.io/v2/docs/static/index.html#/history/get_v2_history_get_table_state | ||
* | ||
* get table state | ||
* | ||
* @param {string} code contract account | ||
* @param {string} table table name | ||
* @param {string} block_num target block | ||
* @param {string} after_key last key for pagination | ||
* @returns {Promise<GetTableState>} get table state | ||
* @example | ||
* | ||
* const response = await rpc.get_table_state("eosio.token", "stat", "1000", ""); | ||
* console.log(response); | ||
* // => { "query_time": 19, "code": "eosio.token", "table": "stat", "block_num": 1000, "next_key": "........ehbo5-5459781",, "results": [ ... ] } | ||
*/ | ||
get_table_state<T>(code: string, table: string, block_num?: number, after_key?: string): Promise<GetTableState<T>>; | ||
/** | ||
* [GET/v2/state/get_key_accounts](https://eos.hyperion.eosrio.io/v2/docs/index.html#/state/get_v2_state_get_key_accounts) | ||
@@ -262,23 +281,2 @@ * | ||
/** | ||
* [GET /v2/history/get_transacted_accounts](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transacted_accounts) | ||
* | ||
* get all account that interacted with the source account provided | ||
* | ||
* @param {string} account source account | ||
* @param {string} direction search direction (in, out or both) | ||
* @returns {Promise<GetTransactedAccounts>} transacted accounts | ||
* @example | ||
* | ||
* const response = await rpc.get_transacted_accounts("eoscafeblock", "in"); | ||
* console.log(response); | ||
* // => { query_time: 268, account: 'eoscafeblock', total_in: 1092369.1827, inputs: [ ... ] } | ||
*/ | ||
get_transacted_accounts(account: string, direction: string, options?: { | ||
symbol?: string; | ||
contract?: string; | ||
min?: number; | ||
max?: number; | ||
limit?: number; | ||
}): Promise<GetTransactedAccounts>; | ||
/** | ||
* [GET /v2/history/get_transaction](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transaction) | ||
@@ -299,35 +297,2 @@ * | ||
get_transaction<T>(id: string): Promise<GetTransaction<T>>; | ||
/** | ||
* [GET /v2/history/get_transfers](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transfers) | ||
* | ||
* get token transfers utilizing the eosio.token standard | ||
* | ||
* @param {object} [options={}] Optional parameters | ||
* @param {string} [options.from] source account | ||
* @param {string} [options.to] destination account | ||
* @param {string} [options.symbol] token symbol | ||
* @param {string} [options.contract] token contract | ||
* @param {number} [options.skip] skip [n] actions (pagination) | ||
* @param {number} [options.limit] limit of [n] actions per page | ||
* @param {string} [options.after] filter after specified date (ISO8601) | ||
* @param {string} [options.before] filter before specified date (ISO8601) | ||
* @returns {Promise<GetTransfers>} transfers | ||
* @example | ||
* | ||
* const response = await rpc.get_transfers({to: "eosnewyorkio"}); | ||
* for (const action of response.actions) { | ||
* console.log(action.act.data); | ||
* // => { from: 'eosio.bpay', to: 'eosnewyorkio', amount: 326.524, symbol: 'EOS', memo: 'producer block pay' } | ||
* } | ||
*/ | ||
get_transfers(options?: { | ||
from?: string; | ||
to?: string; | ||
symbol?: string; | ||
contract?: string; | ||
skip?: number; | ||
limit?: number; | ||
after?: string; | ||
before?: string; | ||
}): Promise<GetTransfers<import("./types/history/get_transfers").TransferData>>; | ||
} |
@@ -49,5 +49,2 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -57,3 +54,4 @@ exports.JsonRpc = void 0; | ||
var rpcerror_1 = require("./rpcerror"); | ||
var cross_fetch_1 = __importDefault(require("cross-fetch")); | ||
require("isomorphic-fetch"); | ||
require("abortcontroller-polyfill/dist/polyfill-patch-fetch"); | ||
function queryParams(params) { | ||
@@ -79,3 +77,3 @@ var entries = []; | ||
id = setTimeout(function () { return controller.abort(); }, timeout); | ||
return [4 /*yield*/, (0, cross_fetch_1.default)(resource, __assign(__assign({}, (options || {})), { signal: controller.signal }))]; | ||
return [4 /*yield*/, fetch(resource, __assign(__assign({}, (options || {})), { signal: controller.signal }))]; | ||
case 1: | ||
@@ -125,3 +123,3 @@ response = _a.sent(); | ||
method: "POST", | ||
timeout: this.timeout | ||
timeout: this.timeout, | ||
})]; | ||
@@ -170,3 +168,3 @@ case 1: | ||
method: "GET", | ||
timeout: this.timeout | ||
timeout: this.timeout, | ||
})]; | ||
@@ -211,3 +209,3 @@ case 2: | ||
JsonRpc.prototype.alive = function () { | ||
return this.get(endpoints_1.V2_ALIVE, {}); | ||
return this.get(endpoints_1.V2_HEALTH, {}); | ||
}; | ||
@@ -408,2 +406,27 @@ /** | ||
/** | ||
* [GET /v2/history/get_table_state](https://eos.hyperion.eosrio.io/v2/docs/static/index.html#/history/get_v2_history_get_table_state | ||
* | ||
* get table state | ||
* | ||
* @param {string} code contract account | ||
* @param {string} table table name | ||
* @param {string} block_num target block | ||
* @param {string} after_key last key for pagination | ||
* @returns {Promise<GetTableState>} get table state | ||
* @example | ||
* | ||
* const response = await rpc.get_table_state("eosio.token", "stat", "1000", ""); | ||
* console.log(response); | ||
* // => { "query_time": 19, "code": "eosio.token", "table": "stat", "block_num": 1000, "next_key": "........ehbo5-5459781",, "results": [ ... ] } | ||
*/ | ||
JsonRpc.prototype.get_table_state = function (code, table, block_num, after_key) { | ||
var params = { | ||
code: code, | ||
table: table, | ||
block_num: block_num, | ||
after_key: after_key, | ||
}; | ||
return this.get(endpoints_1.V2_GET_TABLE_STATE, params); | ||
}; | ||
/** | ||
* [GET/v2/state/get_key_accounts](https://eos.hyperion.eosrio.io/v2/docs/index.html#/state/get_v2_state_get_key_accounts) | ||
@@ -449,21 +472,2 @@ * | ||
/** | ||
* [GET /v2/history/get_transacted_accounts](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transacted_accounts) | ||
* | ||
* get all account that interacted with the source account provided | ||
* | ||
* @param {string} account source account | ||
* @param {string} direction search direction (in, out or both) | ||
* @returns {Promise<GetTransactedAccounts>} transacted accounts | ||
* @example | ||
* | ||
* const response = await rpc.get_transacted_accounts("eoscafeblock", "in"); | ||
* console.log(response); | ||
* // => { query_time: 268, account: 'eoscafeblock', total_in: 1092369.1827, inputs: [ ... ] } | ||
*/ | ||
JsonRpc.prototype.get_transacted_accounts = function (account, direction, options) { | ||
if (options === void 0) { options = {}; } | ||
var params = Object.assign({}, { account: account, direction: direction }, options); | ||
return this.get(endpoints_1.V2_GET_TRANSACTED_ACCOUNTS, params); | ||
}; | ||
/** | ||
* [GET /v2/history/get_transaction](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transaction) | ||
@@ -489,30 +493,2 @@ * | ||
}; | ||
/** | ||
* [GET /v2/history/get_transfers](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transfers) | ||
* | ||
* get token transfers utilizing the eosio.token standard | ||
* | ||
* @param {object} [options={}] Optional parameters | ||
* @param {string} [options.from] source account | ||
* @param {string} [options.to] destination account | ||
* @param {string} [options.symbol] token symbol | ||
* @param {string} [options.contract] token contract | ||
* @param {number} [options.skip] skip [n] actions (pagination) | ||
* @param {number} [options.limit] limit of [n] actions per page | ||
* @param {string} [options.after] filter after specified date (ISO8601) | ||
* @param {string} [options.before] filter before specified date (ISO8601) | ||
* @returns {Promise<GetTransfers>} transfers | ||
* @example | ||
* | ||
* const response = await rpc.get_transfers({to: "eosnewyorkio"}); | ||
* for (const action of response.actions) { | ||
* console.log(action.act.data); | ||
* // => { from: 'eosio.bpay', to: 'eosnewyorkio', amount: 326.524, symbol: 'EOS', memo: 'producer block pay' } | ||
* } | ||
*/ | ||
JsonRpc.prototype.get_transfers = function (options) { | ||
if (options === void 0) { options = {}; } | ||
var params = Object.assign({}, options); | ||
return this.get(endpoints_1.V2_GET_TRANSFERS, params); | ||
}; | ||
return JsonRpc; | ||
@@ -519,0 +495,0 @@ }()); |
@@ -7,4 +7,5 @@ /** | ||
*/ | ||
export declare class RpcError extends Error { | ||
export declare class RpcError { | ||
json: any; | ||
message: string; | ||
constructor(json: any); | ||
@@ -15,5 +16,6 @@ } | ||
*/ | ||
export declare class RpcStatusError extends Error { | ||
export declare class RpcStatusError { | ||
response: any; | ||
message: string; | ||
constructor(response: any); | ||
} |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -25,21 +10,18 @@ exports.RpcStatusError = exports.RpcError = void 0; | ||
*/ | ||
var RpcError = /** @class */ (function (_super) { | ||
__extends(RpcError, _super); | ||
var RpcError = /** @class */ (function () { | ||
function RpcError(json) { | ||
var _this = this; | ||
if (json.error && json.error.details && json.error.details.length && json.error.details[0].message) { | ||
_this = _super.call(this, json.error.details[0].message) || this; | ||
this.message = json.error.details[0].message; | ||
} | ||
else if (json.processed && json.processed.except && json.processed.except.message) { | ||
_this = _super.call(this, json.processed.except.message) || this; | ||
this.message = json.processed.except.message; | ||
} | ||
else { | ||
_this = _super.call(this, json.message) || this; | ||
this.message = json.message; | ||
} | ||
Object.setPrototypeOf(_this, RpcError.prototype); | ||
_this.json = json; | ||
return _this; | ||
Object.setPrototypeOf(this, RpcError.prototype); | ||
this.json = json; | ||
} | ||
return RpcError; | ||
}(Error)); | ||
}()); | ||
exports.RpcError = RpcError; | ||
@@ -49,19 +31,16 @@ /** | ||
*/ | ||
var RpcStatusError = /** @class */ (function (_super) { | ||
__extends(RpcStatusError, _super); | ||
var RpcStatusError = /** @class */ (function () { | ||
function RpcStatusError(response) { | ||
var _this = this; | ||
if (response.status === 405) { | ||
_this = _super.call(this, response.statusText) || this; | ||
this.message = response.statusText; | ||
} | ||
else { | ||
_this = _super.call(this) || this; | ||
this.message = ''; | ||
} | ||
Object.setPrototypeOf(_this, RpcStatusError.prototype); | ||
_this.response = response; | ||
return _this; | ||
Object.setPrototypeOf(this, RpcStatusError.prototype); | ||
this.response = response; | ||
} | ||
return RpcStatusError; | ||
}(Error)); | ||
}()); | ||
exports.RpcStatusError = RpcStatusError; | ||
//# sourceMappingURL=rpcerror.js.map |
@@ -6,10 +6,9 @@ export { GetAbiSnapshot } from "./history/get_abi_snapshot"; | ||
export { GetDeltas } from "./history/get_deltas"; | ||
export { GetTransactedAccounts } from "./history/get_transacted_accounts"; | ||
export { GetTableState } from "./history/get_table_state"; | ||
export { GetTransaction } from "./history/get_transaction"; | ||
export { GetTransfers } from "./history/get_transfers"; | ||
export { Alive } from "./state/alive"; | ||
export { HealthV2 } from "./state/alive"; | ||
export { GetKeyAccounts } from "./state/get_key_accounts"; | ||
export { GetTokens } from "./state/get_tokens"; | ||
export { GetVoters } from "./state/get_voters"; | ||
export { GetLinks } from './state/get_links'; | ||
export { GetProposals } from './state/get_proposals'; | ||
export { GetLinks } from "./state/get_links"; | ||
export { GetProposals } from "./state/get_proposals"; |
@@ -6,3 +6,3 @@ import { Action } from "../action_trace"; | ||
total: Total; | ||
actions: Array<Action<T>>; | ||
actions: Action<T>[]; | ||
} | ||
@@ -9,0 +9,0 @@ interface Total { |
export interface GetDeltas<T> { | ||
query_time: number; | ||
total: Total; | ||
deltas: Array<Delta<T>>; | ||
deltas: Delta<T>[]; | ||
} | ||
@@ -6,0 +6,0 @@ interface Delta<T> { |
@@ -5,3 +5,3 @@ import { Action } from "../action_trace"; | ||
lib: number; | ||
actions: Array<Action<T>>; | ||
actions: Action<T>[]; | ||
} |
@@ -1,3 +0,49 @@ | ||
export interface Alive { | ||
export interface ServiceData { | ||
head_block_num: number; | ||
head_block_time: Date; | ||
time_offset: number; | ||
last_irreversible_block: number; | ||
chain_id: string; | ||
active_shards: string; | ||
head_offset?: number; | ||
first_indexed_block?: number; | ||
last_indexed_block?: number; | ||
total_indexed_blocks?: number; | ||
missing_blocks?: number; | ||
missing_pct: string; | ||
} | ||
export interface Health { | ||
service: string; | ||
status: string; | ||
time: any; | ||
service_data: ServiceData; | ||
} | ||
export interface Streaming { | ||
enable: boolean; | ||
traces: boolean; | ||
deltas: boolean; | ||
} | ||
export interface Tables { | ||
proposals: boolean; | ||
accounts: boolean; | ||
voters: boolean; | ||
} | ||
export interface Features { | ||
streaming: Streaming; | ||
tables: Tables; | ||
index_deltas: boolean; | ||
index_transfer_memo: boolean; | ||
index_all_deltas: boolean; | ||
failed_trx: boolean; | ||
deferred_trx: boolean; | ||
resource_limits: boolean; | ||
resource_usage: boolean; | ||
} | ||
export interface HealthV2 { | ||
version: string; | ||
version_hash: string; | ||
host: string; | ||
health: Health[]; | ||
features: Features; | ||
query_time_ms: number; | ||
} |
{ | ||
"name": "@proton/hyperion", | ||
"version": "3.3.3", | ||
"version": "3.4.0", | ||
"description": "Hyperion HTTP API Javascript library", | ||
@@ -32,8 +32,7 @@ "main": "dist/index.js", | ||
"documentation": "*", | ||
"isomorphic-fetch": "*", | ||
"jest": "*", | ||
"ts-jest": "*", | ||
"ts-node": "*", | ||
"tslint": "*", | ||
"typescript": "^4.6.2" | ||
"jest": "29.0.3", | ||
"ts-jest": "29.0.3", | ||
"ts-node": "10.9.1", | ||
"tslint": "6.1.3", | ||
"typescript": "^4.4.2" | ||
}, | ||
@@ -52,4 +51,8 @@ "directories": { | ||
"dependencies": { | ||
"cross-fetch": "^3.1.5" | ||
"@types/node-fetch": "^2.6.2", | ||
"abortcontroller-polyfill": "^1.7.5", | ||
"cross-fetch": "^3.1.5", | ||
"isomorphic-fetch": "^3.0.0", | ||
"node-fetch": "^3.2.10" | ||
} | ||
} |
419
README.md
@@ -72,85 +72,82 @@ # Hyperion HTTP API Javascript library | ||
- [Hyperion HTTP API Javascript library](#hyperion-http-api-javascript-library) | ||
- [Installation](#installation) | ||
- [Quick Start](#quick-start) | ||
- [ENV Variables](#env-variables) | ||
- [Supported Endpoints](#supported-endpoints) | ||
- [API](#api) | ||
- [Table of Contents](#table-of-contents) | ||
- [JsonRpc](#jsonrpc) | ||
- [Parameters](#parameters) | ||
- [Examples](#examples) | ||
- [alive](#alive) | ||
- [Examples](#examples-1) | ||
- [get_abi_snapshot](#get_abi_snapshot) | ||
- [Parameters](#parameters-1) | ||
- [Examples](#examples-2) | ||
- [get_voters](#get_voters) | ||
- [Parameters](#parameters-2) | ||
- [Examples](#examples-3) | ||
- [get_actions](#get_actions) | ||
- [Parameters](#parameters-3) | ||
- [Examples](#examples-4) | ||
- [get_created_accounts](#get_created_accounts) | ||
- [Parameters](#parameters-4) | ||
- [Examples](#examples-5) | ||
- [get_creator](#get_creator) | ||
- [Parameters](#parameters-5) | ||
- [Examples](#examples-6) | ||
- [get_deltas](#get_deltas) | ||
- [Parameters](#parameters-6) | ||
- [Examples](#examples-7) | ||
- [get_key_accounts](#get_key_accounts) | ||
- [Parameters](#parameters-7) | ||
- [Examples](#examples-8) | ||
- [get_tokens](#get_tokens) | ||
- [Parameters](#parameters-8) | ||
- [Examples](#examples-9) | ||
- [get_transacted_accounts](#get_transacted_accounts) | ||
- [Parameters](#parameters-9) | ||
- [Examples](#examples-10) | ||
- [get_transaction](#get_transaction) | ||
- [Parameters](#parameters-10) | ||
- [Examples](#examples-11) | ||
- [get_transfers](#get_transfers) | ||
- [Parameters](#parameters-11) | ||
- [Examples](#examples-12) | ||
- [JsonRpc](#jsonrpc-1) | ||
- [alive](#alive-1) | ||
- [Examples](#examples-13) | ||
- [get_abi_snapshot](#get_abi_snapshot-1) | ||
- [Parameters](#parameters-12) | ||
- [Examples](#examples-14) | ||
- [get_voters](#get_voters-1) | ||
- [Parameters](#parameters-13) | ||
- [Examples](#examples-15) | ||
- [get_actions](#get_actions-1) | ||
- [Parameters](#parameters-14) | ||
- [Examples](#examples-16) | ||
- [get_created_accounts](#get_created_accounts-1) | ||
- [Parameters](#parameters-15) | ||
- [Examples](#examples-17) | ||
- [get_creator](#get_creator-1) | ||
- [Parameters](#parameters-16) | ||
- [Examples](#examples-18) | ||
- [get_deltas](#get_deltas-1) | ||
- [Parameters](#parameters-17) | ||
- [Examples](#examples-19) | ||
- [get_key_accounts](#get_key_accounts-1) | ||
- [Parameters](#parameters-18) | ||
- [Examples](#examples-20) | ||
- [get_tokens](#get_tokens-1) | ||
- [Parameters](#parameters-19) | ||
- [Examples](#examples-21) | ||
- [get_transacted_accounts](#get_transacted_accounts-1) | ||
- [Parameters](#parameters-20) | ||
- [Examples](#examples-22) | ||
- [get_transaction](#get_transaction-1) | ||
- [Parameters](#parameters-21) | ||
- [Examples](#examples-23) | ||
- [get_transfers](#get_transfers-1) | ||
- [Parameters](#parameters-22) | ||
- [Examples](#examples-24) | ||
- [Error](#error) | ||
- [Error](#error-1) | ||
- [JsonRpc](#jsonrpc) | ||
- [Parameters](#parameters) | ||
- [Examples](#examples) | ||
- [alive](#alive) | ||
- [Examples](#examples-1) | ||
- [get_abi_snapshot](#get_abi_snapshot) | ||
- [Parameters](#parameters-1) | ||
- [Examples](#examples-2) | ||
- [get_voters](#get_voters) | ||
- [Parameters](#parameters-2) | ||
- [Examples](#examples-3) | ||
- [get_links](#get_links) | ||
- [Parameters](#parameters-3) | ||
- [Examples](#examples-4) | ||
- [get_proposals](#get_proposals) | ||
- [Parameters](#parameters-4) | ||
- [get_actions](#get_actions) | ||
- [Parameters](#parameters-5) | ||
- [Examples](#examples-5) | ||
- [get_created_accounts](#get_created_accounts) | ||
- [Parameters](#parameters-6) | ||
- [Examples](#examples-6) | ||
- [get_creator](#get_creator) | ||
- [Parameters](#parameters-7) | ||
- [Examples](#examples-7) | ||
- [get_deltas](#get_deltas) | ||
- [Parameters](#parameters-8) | ||
- [Examples](#examples-8) | ||
- [get_table_state](#get_table_state) | ||
- [Parameters](#parameters-9) | ||
- [Examples](#examples-9) | ||
- [get_key_accounts](#get_key_accounts) | ||
- [Parameters](#parameters-10) | ||
- [Examples](#examples-10) | ||
- [get_tokens](#get_tokens) | ||
- [Parameters](#parameters-11) | ||
- [Examples](#examples-11) | ||
- [get_transaction](#get_transaction) | ||
- [Parameters](#parameters-12) | ||
- [Examples](#examples-12) | ||
- [JsonRpc](#jsonrpc-1) | ||
- [alive](#alive-1) | ||
- [Examples](#examples-13) | ||
- [get_abi_snapshot](#get_abi_snapshot-1) | ||
- [Parameters](#parameters-13) | ||
- [Examples](#examples-14) | ||
- [get_voters](#get_voters-1) | ||
- [Parameters](#parameters-14) | ||
- [Examples](#examples-15) | ||
- [get_links](#get_links-1) | ||
- [Parameters](#parameters-15) | ||
- [Examples](#examples-16) | ||
- [get_proposals](#get_proposals-1) | ||
- [Parameters](#parameters-16) | ||
- [get_actions](#get_actions-1) | ||
- [Parameters](#parameters-17) | ||
- [Examples](#examples-17) | ||
- [get_created_accounts](#get_created_accounts-1) | ||
- [Parameters](#parameters-18) | ||
- [Examples](#examples-18) | ||
- [get_creator](#get_creator-1) | ||
- [Parameters](#parameters-19) | ||
- [Examples](#examples-19) | ||
- [get_deltas](#get_deltas-1) | ||
- [Parameters](#parameters-20) | ||
- [Examples](#examples-20) | ||
- [get_table_state](#get_table_state-1) | ||
- [Parameters](#parameters-21) | ||
- [Examples](#examples-21) | ||
- [get_key_accounts](#get_key_accounts-1) | ||
- [Parameters](#parameters-22) | ||
- [Examples](#examples-22) | ||
- [get_tokens](#get_tokens-1) | ||
- [Parameters](#parameters-23) | ||
- [Examples](#examples-23) | ||
- [get_transaction](#get_transaction-1) | ||
- [Parameters](#parameters-24) | ||
- [Examples](#examples-24) | ||
- [RpcError](#rpcerror) | ||
- [RpcStatusError](#rpcstatuserror) | ||
@@ -197,3 +194,3 @@ ### JsonRpc | ||
- `contract` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** contract account | ||
- `block` | ||
- `block` | ||
- `number` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** target block | ||
@@ -244,2 +241,50 @@ | ||
#### get_links | ||
[GET /v2/state/get_links](https://eos.hyperion.eosrio.io/v2/docs/index.html#/state/get_v2_state_links) | ||
get voters | ||
##### Parameters | ||
- `account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** account to get links for | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_links("eoscafeblock"); | ||
console.log(response.links); | ||
// => "[{ | ||
"block_num":26088072, | ||
"timestamp":"2019-11-22T23:17:42.000", | ||
"account":"eosriobrazil", | ||
"permission":"claim2", | ||
"code":"eosio", | ||
"action":"voteproducer" | ||
}]" | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetLinks>** links | ||
#### get_proposals | ||
[GET /v2/state/get_proposals](https://eos.hyperion.eosrio.io/v2/docs/index.html#/state/get_v2_state_get_proposals) | ||
get proposals | ||
##### Parameters | ||
- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`) | ||
- `options.proposer` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by proposer | ||
- `options.proposal` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by proposal name | ||
- `options.account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by either requested or provided account | ||
- `options.requested` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by requested account | ||
- `options.provided` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by provided account | ||
- `options.track` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** total results to track (count) [number or true] | ||
- `options.skip` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** skip [n] actions (pagination) | ||
- `options.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** limit of [n] actions per page | ||
- `account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** account to get proposals for | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetProposals>** proposals | ||
#### get_actions | ||
@@ -336,2 +381,3 @@ | ||
- `payer` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** payer account | ||
- `options` | ||
@@ -348,2 +394,25 @@ ##### Examples | ||
#### get_table_state | ||
[GET /v2/history/get_table_state]\(<https://eos.hyperion.eosrio.io/v2/docs/static/index.html#/history/get_v2_history_get_table_state> | ||
get table state | ||
##### Parameters | ||
- `code` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** contract account | ||
- `table` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** table name | ||
- `block_num` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** target block | ||
- `after_key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** last key for pagination | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_table_state("eosio.token", "stat", "1000", ""); | ||
console.log(response); | ||
// => { "query_time": 19, "code": "eosio.token", "table": "stat", "block_num": 1000, "next_key": "........ehbo5-5459781",, "results": [ ... ] } | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetTableState>** get table state | ||
#### get_key_accounts | ||
@@ -391,24 +460,2 @@ | ||
#### get_transacted_accounts | ||
[GET /v2/history/get_transacted_accounts](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transacted_accounts) | ||
get all account that interacted with the source account provided | ||
##### Parameters | ||
- `account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** source account | ||
- `direction` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** search direction (in, out or both) | ||
- `options` | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_transacted_accounts("eoscafeblock", "in"); | ||
console.log(response); | ||
// => { query_time: 268, account: 'eoscafeblock', total_in: 1092369.1827, inputs: [ ... ] } | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetTransactedAccounts>** transacted accounts | ||
#### get_transaction | ||
@@ -436,32 +483,2 @@ | ||
#### get_transfers | ||
[GET /v2/history/get_transfers](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transfers) | ||
get token transfers utilizing the eosio.token standard | ||
##### Parameters | ||
- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`) | ||
- `options.from` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** source account | ||
- `options.to` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** destination account | ||
- `options.symbol` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** token symbol | ||
- `options.contract` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** token contract | ||
- `options.skip` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** skip [n] actions (pagination) | ||
- `options.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** limit of [n] actions per page | ||
- `options.after` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter after specified date (ISO8601) | ||
- `options.before` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter before specified date (ISO8601) | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_transfers({to: "eosnewyorkio"}); | ||
for (const action of response.actions) { | ||
console.log(action.act.data); | ||
// => { from: 'eosio.bpay', to: 'eosnewyorkio', amount: 326.524, symbol: 'EOS', memo: 'producer block pay' } | ||
} | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetTransfers>** transfers | ||
### JsonRpc | ||
@@ -494,3 +511,3 @@ | ||
- `contract` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** contract account | ||
- `block` | ||
- `block` | ||
- `number` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** target block | ||
@@ -541,2 +558,50 @@ | ||
#### get_links | ||
[GET /v2/state/get_links](https://eos.hyperion.eosrio.io/v2/docs/index.html#/state/get_v2_state_links) | ||
get voters | ||
##### Parameters | ||
- `account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** account to get links for | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_links("eoscafeblock"); | ||
console.log(response.links); | ||
// => "[{ | ||
"block_num":26088072, | ||
"timestamp":"2019-11-22T23:17:42.000", | ||
"account":"eosriobrazil", | ||
"permission":"claim2", | ||
"code":"eosio", | ||
"action":"voteproducer" | ||
}]" | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetLinks>** links | ||
#### get_proposals | ||
[GET /v2/state/get_proposals](https://eos.hyperion.eosrio.io/v2/docs/index.html#/state/get_v2_state_get_proposals) | ||
get proposals | ||
##### Parameters | ||
- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`) | ||
- `options.proposer` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by proposer | ||
- `options.proposal` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by proposal name | ||
- `options.account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by either requested or provided account | ||
- `options.requested` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by requested account | ||
- `options.provided` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter by provided account | ||
- `options.track` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** total results to track (count) [number or true] | ||
- `options.skip` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** skip [n] actions (pagination) | ||
- `options.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** limit of [n] actions per page | ||
- `account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** account to get proposals for | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetProposals>** proposals | ||
#### get_actions | ||
@@ -633,2 +698,3 @@ | ||
- `payer` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** payer account | ||
- `options` | ||
@@ -645,2 +711,25 @@ ##### Examples | ||
#### get_table_state | ||
[GET /v2/history/get_table_state]\(<https://eos.hyperion.eosrio.io/v2/docs/static/index.html#/history/get_v2_history_get_table_state> | ||
get table state | ||
##### Parameters | ||
- `code` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** contract account | ||
- `table` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** table name | ||
- `block_num` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** target block | ||
- `after_key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** last key for pagination | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_table_state("eosio.token", "stat", "1000", ""); | ||
console.log(response); | ||
// => { "query_time": 19, "code": "eosio.token", "table": "stat", "block_num": 1000, "next_key": "........ehbo5-5459781",, "results": [ ... ] } | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetTableState>** get table state | ||
#### get_key_accounts | ||
@@ -688,24 +777,2 @@ | ||
#### get_transacted_accounts | ||
[GET /v2/history/get_transacted_accounts](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transacted_accounts) | ||
get all account that interacted with the source account provided | ||
##### Parameters | ||
- `account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** source account | ||
- `direction` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** search direction (in, out or both) | ||
- `options` | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_transacted_accounts("eoscafeblock", "in"); | ||
console.log(response); | ||
// => { query_time: 268, account: 'eoscafeblock', total_in: 1092369.1827, inputs: [ ... ] } | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetTransactedAccounts>** transacted accounts | ||
#### get_transaction | ||
@@ -733,34 +800,4 @@ | ||
#### get_transfers | ||
### RpcError | ||
[GET /v2/history/get_transfers](https://eos.hyperion.eosrio.io/v2/docs/index.html#/history/get_v2_history_get_transfers) | ||
get token transfers utilizing the eosio.token standard | ||
##### Parameters | ||
- `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`) | ||
- `options.from` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** source account | ||
- `options.to` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** destination account | ||
- `options.symbol` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** token symbol | ||
- `options.contract` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** token contract | ||
- `options.skip` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** skip [n] actions (pagination) | ||
- `options.limit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** limit of [n] actions per page | ||
- `options.after` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter after specified date (ISO8601) | ||
- `options.before` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** filter before specified date (ISO8601) | ||
##### Examples | ||
```javascript | ||
const response = await rpc.get_transfers({to: "eosnewyorkio"}); | ||
for (const action of response.actions) { | ||
console.log(action.act.data); | ||
// => { from: 'eosio.bpay', to: 'eosnewyorkio', amount: 326.524, symbol: 'EOS', memo: 'producer block pay' } | ||
} | ||
``` | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<GetTransfers>** transfers | ||
### Error | ||
### Error | ||
### RpcStatusError |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
10
66
791
87431
5
1227
1
+ Added@types/node-fetch@^2.6.2
+ Addedisomorphic-fetch@^3.0.0
+ Addednode-fetch@^3.2.10
+ Added@types/node@22.13.4(transitive)
+ Added@types/node-fetch@2.6.12(transitive)
+ Addedabortcontroller-polyfill@1.7.8(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedform-data@4.0.2(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedisomorphic-fetch@3.0.0(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
+ Addedwhatwg-fetch@3.6.20(transitive)