├── .gitignore ├── CHANGELOG.md ├── README.md ├── examples ├── config.ts ├── get_actions.ts ├── get_actions_multiple.ts ├── get_table_rows.ts └── get_transaction.ts ├── index.ts ├── package.json ├── tsconfig.json ├── tslint.json └── types ├── action_trace.d.ts ├── action_trace.json ├── ping.d.ts ├── ping.json ├── table_rows.d.ts └── table_rows.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn-error.log 3 | yarn.lock 4 | package-lock.json 5 | .DS_Store 6 | dist 7 | 8 | *.js 9 | .env 10 | index.d.ts -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### 2018-10-09 2 | 3 | **CHANGES** 4 | 5 | - On `get_actions`, `receiver` is now optional and defaults to the same value as account. 6 | - The `get_table_deltas` request was renamed to `get_table_rows`. 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EOS WebSocket 2 | ## ⚠️DEPRECATED ⚠️ 3 | 4 | > Library is now being maintained at https://github.com/dfuse-io/eosws-js 5 | 6 | > Go to https://www.dfuse.io and click on `"Get a Free API Key"` 7 | 8 | ## EOSWS Servers 9 | 10 | **Mainnet** 11 | 12 | - `wss://mainnet.eos.dfuse.io/v1/stream?token=[API TOKEN]` 13 | 14 | **Kylin** 15 | 16 | - `wss://kylin.eos.dfuse.io/v1/stream?token=[API TOKEN]` 17 | 18 | ## Install 19 | 20 | **npm** 21 | 22 | ```bash 23 | $ npm install --save eosws 24 | ``` 25 | 26 | ## Quickstart 27 | 28 | ### Get Actions 29 | 30 | ```ts 31 | import WebSocket from "ws"; 32 | import { get_actions, parse_actions } from "eosws"; 33 | 34 | const API_TOKEN = "eyJ...IBg"; 35 | const origin = "https://example.com"; 36 | const ws = new WebSocket(`wss:///v1/stream?token=${API_TOKEN}`, {origin}); 37 | 38 | ws.onopen = () => { 39 | ws.send(get_actions("eosio.token", "transfer")); 40 | }; 41 | 42 | ws.onmessage = (message) => { 43 | const actions = parse_actions(message.data); 44 | 45 | if (actions) { 46 | const { from, to, quantity, memo } = actions.data.trace.act.data; 47 | console.log(from , to, quantity, memo); 48 | } 49 | }; 50 | ``` 51 | 52 | ### Get Table Rows 53 | 54 | ```ts 55 | import { get_table_rows, parse_table_rows } from "eosws"; 56 | 57 | ws.onopen = () => { 58 | ws.send(get_table_rows("eosio", "eosio", "voters")); 59 | }; 60 | 61 | ws.onmessage = (message) => { 62 | const table = parse_table_rows(message.data, voters_req_id); 63 | 64 | if (table) { 65 | const {owner, producers, last_vote_weight} = table.data.row; 66 | console.log(owner, producers, last_vote_weight); 67 | } 68 | }; 69 | ``` 70 | 71 | ## Related Javascript 72 | 73 | - [x] WebSockets () 74 | - [ ] Socket.io () 75 | 76 | ## Related Video 77 | 78 | - Push Irreversible Transaction () 79 | 80 | ## API 81 | 82 | 83 | 84 | #### Table of Contents 85 | 86 | - [get_actions](#get_actions) 87 | - [Parameters](#parameters) 88 | - [Examples](#examples) 89 | - [get_table_rows](#get_table_rows) 90 | - [Parameters](#parameters-1) 91 | - [Examples](#examples-1) 92 | - [unlisten](#unlisten) 93 | - [Parameters](#parameters-2) 94 | - [Examples](#examples-2) 95 | - [generateReqId](#generatereqid) 96 | - [Examples](#examples-3) 97 | - [parse_actions](#parse_actions) 98 | - [Parameters](#parameters-3) 99 | - [Examples](#examples-4) 100 | - [parse_table_rows](#parse_table_rows) 101 | - [Parameters](#parameters-4) 102 | - [Examples](#examples-5) 103 | - [parse_ping](#parse_ping) 104 | - [Parameters](#parameters-5) 105 | - [Examples](#examples-6) 106 | 107 | ### get_actions 108 | 109 | Get Actions 110 | 111 | #### Parameters 112 | 113 | - `account` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Account 114 | - `action_name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Action Name 115 | - `receiver` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Receiver 116 | - `options` (optional, default `{}`) 117 | 118 | #### Examples 119 | 120 | ```javascript 121 | ws.send(get_actions("eosio.token", "transfer")); 122 | ``` 123 | 124 | Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Message for `ws.send` 125 | 126 | ### get_table_rows 127 | 128 | Get Table Deltas 129 | 130 | #### Parameters 131 | 132 | - `code` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Code 133 | - `scope` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Scope 134 | - `table_name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Table Name 135 | - `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional parameters (optional, default `{}`) 136 | - `options.req_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Request ID 137 | - `options.start_block` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Start at block number 138 | - `options.fetch` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Fetch initial request 139 | 140 | #### Examples 141 | 142 | ```javascript 143 | ws.send(get_table_rows("eosio", "eosio", "global")); 144 | ``` 145 | 146 | Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Message for `ws.send` 147 | 148 | ### unlisten 149 | 150 | Unlisten to WebSocket based on request id 151 | 152 | #### Parameters 153 | 154 | - `req_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Request ID 155 | 156 | #### Examples 157 | 158 | ```javascript 159 | ws.send(unlisten("req123")); 160 | ``` 161 | 162 | ### generateReqId 163 | 164 | Generate Req ID 165 | 166 | #### Examples 167 | 168 | ```javascript 169 | generateReqId() // => req123 170 | ``` 171 | 172 | Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Request ID 173 | 174 | ### parse_actions 175 | 176 | Parse Actions from `get_actions` from WebSocket `onmessage` listener 177 | 178 | #### Parameters 179 | 180 | - `data` **WebSocketData** WebSocket Data from message event 181 | - `req_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Request ID 182 | 183 | #### Examples 184 | 185 | ```javascript 186 | const actions = parse_actions(message); 187 | ``` 188 | 189 | Returns **ActionTrace** Action Trace 190 | 191 | ### parse_table_rows 192 | 193 | Parse Table Deltas from `get_table_rows` from WebSocket `onmessage` listener 194 | 195 | #### Parameters 196 | 197 | - `data` **WebSocketData** WebSocket Data from message event 198 | - `req_id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Request ID 199 | 200 | #### Examples 201 | 202 | ```javascript 203 | const table_deltas = parse_table_rows(message); 204 | ``` 205 | 206 | Returns **ActionTrace** Action Trace 207 | 208 | ### parse_ping 209 | 210 | Parse Ping from WebSocket `onmessage` listener 211 | 212 | #### Parameters 213 | 214 | - `data` **WebSocketData** WebSocket Data from message event 215 | 216 | #### Examples 217 | 218 | ```javascript 219 | const ping = parse_ping(message); 220 | ``` 221 | 222 | Returns **Ping** Ping 223 | -------------------------------------------------------------------------------- /examples/config.ts: -------------------------------------------------------------------------------- 1 | import * as path from "path"; 2 | import WebSocket from "ws"; 3 | import dotenv from "dotenv"; 4 | 5 | dotenv.config({path: path.join(__dirname, "..", ".env")}); 6 | 7 | export const EOSWS_API_KEY = process.env.EOSWS_API_KEY; 8 | 9 | if (!EOSWS_API_KEY) { throw new Error("missing EOSWS_API_KEY in your environment variables"); } 10 | 11 | const origin = "https://github.com/eos-nation/eosws"; 12 | export const ws = new WebSocket(`wss://eosws.mainnet.eoscanada.com/v1/stream?token=${EOSWS_API_KEY}`, {origin}); 13 | -------------------------------------------------------------------------------- /examples/get_actions.ts: -------------------------------------------------------------------------------- 1 | import { ws } from "./config"; 2 | import { get_actions, parse_actions } from ".."; 3 | 4 | ws.onopen = () => { 5 | ws.send(get_actions("eosio.token", "transfer", "eosio.token")); 6 | }; 7 | 8 | ws.onmessage = (message) => { 9 | const actions = parse_actions(message.data); 10 | 11 | if (actions) { 12 | const { from, to, quantity, memo } = actions.data.trace.act.data; 13 | console.log(from , to, quantity, memo); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /examples/get_actions_multiple.ts: -------------------------------------------------------------------------------- 1 | import { ws } from "./config"; 2 | import { get_actions, parse_actions, generateReqId } from ".."; 3 | 4 | interface Transfer { 5 | from: string; 6 | to: string; 7 | quantity: string; 8 | memo: string; 9 | } 10 | 11 | interface Issue { 12 | to: string; 13 | quantity: string; 14 | memo: string; 15 | issuer: string; 16 | } 17 | 18 | const transfer_req_id = generateReqId(); 19 | const issue_req_id = generateReqId(); 20 | 21 | ws.onopen = () => { 22 | ws.send(get_actions("eosio.token", "transfer", "eosio.token", {req_id: transfer_req_id})); 23 | ws.send(get_actions("eosio.token", "issue", "eosio.token", {req_id: issue_req_id})); 24 | }; 25 | 26 | ws.onmessage = (message) => { 27 | const transfer_actions = parse_actions(message.data, transfer_req_id); 28 | const issue_actions = parse_actions(message.data, transfer_req_id); 29 | 30 | if (transfer_actions) { 31 | const { from, to, quantity, memo } = transfer_actions.data.trace.act.data; 32 | console.log(from , to, quantity, memo); 33 | } 34 | if (issue_actions) { 35 | const { to, quantity, memo, issuer } = issue_actions.data.trace.act.data; 36 | console.log(to, quantity, memo, issuer); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /examples/get_table_rows.ts: -------------------------------------------------------------------------------- 1 | import { ws } from "./config"; 2 | import { get_table_rows, parse_table_rows } from ".."; 3 | 4 | ws.onopen = () => { 5 | ws.send(get_table_rows("eosio", "eosio", "voters")); 6 | }; 7 | 8 | ws.onmessage = (message) => { 9 | console.log(message.data); 10 | const table = parse_table_rows(message.data); 11 | 12 | if (table) { 13 | const {owner, producers, last_vote_weight} = table.data.row; 14 | console.log(owner, producers, last_vote_weight); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /examples/get_transaction.ts: -------------------------------------------------------------------------------- 1 | import { ws } from "./config"; 2 | import { get_transaction } from ".."; 3 | 4 | ws.onopen = () => { 5 | ws.send(get_transaction("d9e98cec9fcb5604da38ca250eb22246520bfeee2c35298032c2fbb825eb406d", {fetch: true})); 6 | }; 7 | 8 | ws.onmessage = (message) => { 9 | console.log(message.data); 10 | }; 11 | -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | import { ActionTrace } from "./types/action_trace"; 2 | import { Ping } from "./types/ping"; 3 | import { TableRows } from "./types/table_rows"; 4 | export { ActionTrace, Ping, TableRows }; 5 | 6 | /** 7 | * Data represents the message payload received over the WebSocket. 8 | * 9 | * @private 10 | */ 11 | type WebSocketData = string | Buffer | ArrayBuffer | Buffer[]; 12 | 13 | /** 14 | * Get Actions 15 | * 16 | * @param {string} account Account 17 | * @param {string} action_name Action Name 18 | * @param {string} [receiver] Receiver 19 | * @param {string} [options.req_id] Request ID 20 | * @param {number} [options.start_block] Start at block number 21 | * @param {boolean} [options.fetch] Fetch initial request 22 | * @returns {string} Message for `ws.send` 23 | * @example 24 | * 25 | * ws.send(get_actions("eosio.token", "transfer")); 26 | */ 27 | export function get_actions(account: string, action_name: string, receiver?: string, options: { 28 | req_id?: string, 29 | start_block?: number, 30 | fetch?: boolean, 31 | } = {}) { 32 | const req_id = options.req_id ? options.req_id : generateReqId(); 33 | const start_block = options.start_block; 34 | const fetch = options.fetch; 35 | 36 | return JSON.stringify({ 37 | type: "get_actions", 38 | req_id, 39 | listen: true, 40 | fetch, 41 | start_block, 42 | data: { 43 | account, 44 | action_name, 45 | receiver, 46 | }, 47 | }); 48 | } 49 | 50 | /** 51 | * Get Transaction (NOT STABLE YET) 52 | * 53 | * @private 54 | * @param {string} account Account 55 | * @param {string} action_name Action Name 56 | * @param {string} [receiver] Receiver 57 | * @param {object} [options={}] Optional parameters 58 | * @param {string} [options.req_id] Request ID 59 | * @param {number} [options.start_block] Start at block number 60 | * @param {boolean} [options.fetch] Fetch initial request 61 | * @returns {string} Message for `ws.send` 62 | * @example 63 | * 64 | * ws.send(get_transaction("517...86d")); 65 | */ 66 | export function get_transaction(trx_id: string, options: { 67 | req_id?: string, 68 | start_block?: number, 69 | fetch?: boolean, 70 | } = {}) { 71 | const req_id = options.req_id ? options.req_id : generateReqId(); 72 | const start_block = options.start_block; 73 | const fetch = options.fetch; 74 | 75 | return JSON.stringify({ 76 | type: "get_transaction", 77 | req_id, 78 | listen: true, 79 | fetch, 80 | start_block, 81 | data: { 82 | id: trx_id, 83 | }, 84 | }); 85 | } 86 | 87 | /** 88 | * Get Table Deltas 89 | * 90 | * @param {string} code Code 91 | * @param {string} scope Scope 92 | * @param {string} table_name Table Name 93 | * @param {object} [options={}] Optional parameters 94 | * @param {string} [options.req_id] Request ID 95 | * @param {number} [options.start_block] Start at block number 96 | * @param {boolean} [options.fetch] Fetch initial request 97 | * @returns {string} Message for `ws.send` 98 | * @example 99 | * 100 | * ws.send(get_table_rows("eosio", "eosio", "global")); 101 | */ 102 | export function get_table_rows(code: string, scope: string, table_name: string, options: { 103 | req_id?: string, 104 | start_block?: number, 105 | fetch?: boolean, 106 | } = {}) { 107 | const req_id = options.req_id ? options.req_id : generateReqId(); 108 | const start_block = options.start_block; 109 | const fetch = options.fetch; 110 | 111 | return JSON.stringify({ 112 | type: "get_table_rows", 113 | req_id, 114 | listen: true, 115 | fetch, 116 | start_block, 117 | data: { 118 | code, 119 | scope, 120 | table_name, 121 | json: true, 122 | }, 123 | }); 124 | } 125 | 126 | /** 127 | * Unlisten to WebSocket based on request id 128 | * 129 | * @param {string} req_id Request ID 130 | * @example 131 | * 132 | * ws.send(unlisten("req123")); 133 | */ 134 | export function unlisten(req_id: string) { 135 | if (!req_id) { throw new Error("req_id is required"); } 136 | 137 | return JSON.stringify({ 138 | type: "unlisten", 139 | data: { 140 | req_id, 141 | }, 142 | }); 143 | } 144 | 145 | /** 146 | * Generate Req ID 147 | * 148 | * @returns {string} Request ID 149 | * @example 150 | * 151 | * generateReqId() // => req123 152 | */ 153 | export function generateReqId() { 154 | return "req" + Math.round(Math.random() * 1000); 155 | } 156 | 157 | /** 158 | * Parse Actions from `get_actions` from WebSocket `onmessage` listener 159 | * 160 | * @param {WebSocketData} data WebSocket Data from message event 161 | * @param {string} [req_id] Request ID 162 | * @returns {ActionTrace} Action Trace 163 | * @example 164 | * 165 | * const actions = parse_actions(message); 166 | */ 167 | export function parse_actions(data: WebSocketData, req_id?: string): ActionTrace | null { 168 | const message = parse_message(data); 169 | if (message.type === "action_trace") { 170 | if (req_id && message.req_id !== req_id) { return null; } 171 | return message; 172 | } 173 | return null; 174 | } 175 | 176 | /** 177 | * Parse Table Deltas from `get_table_rows` from WebSocket `onmessage` listener 178 | * 179 | * @param {WebSocketData} data WebSocket Data from message event 180 | * @param {string} [req_id] Request ID 181 | * @returns {ActionTrace} Action Trace 182 | * @example 183 | * 184 | * const table_deltas = parse_table_rows(message); 185 | */ 186 | export function parse_table_rows(data: WebSocketData, req_id?: string): TableRows | null { 187 | const message = parse_message(data); 188 | if (message.type === "table_rows" || message.type === "table_delta") { 189 | if (req_id && message.req_id !== req_id) { return null; } 190 | return message; 191 | } 192 | return null; 193 | } 194 | 195 | /** 196 | * Parse Ping from WebSocket `onmessage` listener 197 | * 198 | * @param {WebSocketData} data WebSocket Data from message event 199 | * @returns {Ping} Ping 200 | * @example 201 | * 202 | * const ping = parse_ping(message); 203 | */ 204 | export function parse_ping(data: WebSocketData): Ping | null { 205 | const message = parse_message(data); 206 | if (message.type === "ping") { return message; } 207 | return null; 208 | } 209 | 210 | /** 211 | * Parse MessageEvent from WebSocket `onmessage` listener 212 | * 213 | * @private 214 | * @param {WebSocketData} data WebSocket Data from message event 215 | * @returns {Object} Message Data 216 | */ 217 | export function parse_message(data: WebSocketData): any { 218 | return JSON.parse(data.toString()); 219 | } 220 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eosws", 3 | "version": "1.2.1", 4 | "description": "EOS WebSocket", 5 | "main": "index.js", 6 | "types": "index.d.js", 7 | "files": [ 8 | "index.js", 9 | "index.d.ts", 10 | "types" 11 | ], 12 | "repository": "git@github.com:EOS-Nation/eosws.git", 13 | "author": { 14 | "name": "Denis Carriere", 15 | "email": "denis@eosnation.io", 16 | "url": "https://eosnation.io" 17 | }, 18 | "license": "MIT", 19 | "scripts": { 20 | "prepare": "tsc", 21 | "test": "tslint --project .", 22 | "docs": "tsc && documentation readme index.js --section=API" 23 | }, 24 | "devDependencies": { 25 | "@types/dotenv": "*", 26 | "@types/ws": "*", 27 | "documentation": "*", 28 | "dotenv": "*", 29 | "tslint": "*", 30 | "typescript": "*", 31 | "ws": "ws" 32 | }, 33 | "dependencies": {} 34 | } 35 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ 5 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 6 | "declaration": true, 7 | 8 | /* Strict Type-Checking Options */ 9 | "strict": true, /* Enable all strict type-checking options. */ 10 | 11 | /* Module Resolution Options */ 12 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 13 | }, 14 | "files": [ 15 | "index.ts" 16 | ], 17 | "includes": [ 18 | "types/**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "error", 3 | "extends": [ 4 | "tslint:recommended" 5 | ], 6 | "jsRules": {}, 7 | "rules": { 8 | "no-console": false, 9 | "object-literal-sort-keys": false, 10 | "interface-name": false, 11 | "variable-name": false, 12 | "ordered-imports": false 13 | }, 14 | "rulesDirectory": [] 15 | } -------------------------------------------------------------------------------- /types/action_trace.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by https://quicktype.io 2 | // 3 | // To change quicktype's target language, run command: 4 | // 5 | // "Set quicktype target language" 6 | 7 | export interface ActionTrace { 8 | type: string; 9 | req_id: string; 10 | data: ActionTraceData; 11 | } 12 | 13 | export interface ActionTraceData { 14 | trx_id: string; 15 | idx: number; 16 | depth: number; 17 | trace: Trace; 18 | } 19 | 20 | export interface Trace { 21 | receipt: Receipt; 22 | act: Act; 23 | elapsed: number; 24 | cpu_usage: number; 25 | console: string; 26 | total_cpu_usage: number; 27 | trx_id: string; 28 | inline_traces: any[]; 29 | } 30 | 31 | export interface Act { 32 | account: string; 33 | name: string; 34 | authorization: Authorization[]; 35 | data: T; 36 | hex_data: string; 37 | } 38 | 39 | export interface Authorization { 40 | actor: string; 41 | permission: string; 42 | } 43 | 44 | export interface Receipt { 45 | receiver: string; 46 | act_digest: string; 47 | global_sequence: number; 48 | recv_sequence: number; 49 | auth_sequence: Array>; 50 | code_sequence: number; 51 | abi_sequence: number; 52 | } 53 | -------------------------------------------------------------------------------- /types/action_trace.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "action_trace", 3 | "req_id": "req725", 4 | "data": { 5 | "trx_id": "9a94f921d09ad41eb7786d5b9a88160eb39755b4f9d2b5b9f824dc83d14b919f", 6 | "idx": 0, 7 | "depth": 0, 8 | "trace": { 9 | "receipt": { 10 | "receiver": "eosio.token", 11 | "act_digest": "c510bf94909b6e8ac005eea3ca395c073042d5b6dc022b76f650ef8a142d237b", 12 | "global_sequence": 29888108, 13 | "recv_sequence": 1279946, 14 | "auth_sequence": [ 15 | [ 16 | "deniscarrier", 17 | 78 18 | ] 19 | ], 20 | "code_sequence": 2, 21 | "abi_sequence": 2 22 | }, 23 | "act": { 24 | "account": "eosio.token", 25 | "name": "transfer", 26 | "authorization": [ 27 | { 28 | "actor": "deniscarrier", 29 | "permission": "active" 30 | } 31 | ], 32 | "data": { 33 | "from": "deniscarrier", 34 | "to": "eosasia11111", 35 | "quantity": "1.0000 EOS", 36 | "memo": "" 37 | }, 38 | "hex_data": "7095bbd720eca64a104208c1386c3055102700000000000004454f530000000000" 39 | }, 40 | "elapsed": 332, 41 | "cpu_usage": 0, 42 | "console": "", 43 | "total_cpu_usage": 0, 44 | "trx_id": "9a94f921d09ad41eb7786d5b9a88160eb39755b4f9d2b5b9f824dc83d14b919f", 45 | "inline_traces": [] 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /types/ping.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by https://quicktype.io 2 | // 3 | // To change quicktype's target language, run command: 4 | // 5 | // "Set quicktype target language" 6 | 7 | export interface Ping { 8 | type: string; 9 | data: string; 10 | } 11 | -------------------------------------------------------------------------------- /types/ping.json: -------------------------------------------------------------------------------- 1 | { 2 | "type":"ping", 3 | "data":"2018-09-19T20:42:41.881671294Z" 4 | } -------------------------------------------------------------------------------- /types/table_rows.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by https://quicktype.io 2 | // 3 | // To change quicktype's target language, run command: 4 | // 5 | // "Set quicktype target language" 6 | 7 | export interface TableRows { 8 | type: string; 9 | req_id: string; 10 | data: Data; 11 | } 12 | 13 | export interface Data { 14 | block_num: number; 15 | op: string; 16 | key: string; 17 | payer: string; 18 | data: T; 19 | } 20 | -------------------------------------------------------------------------------- /types/table_rows.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "table_delta", 3 | "req_id": "req716", 4 | "data": { 5 | "block_num": 11191020, 6 | "op": "upd", 7 | "key": "global", 8 | "row": { 9 | "last_name_close": "2037-06-07T08:18:32", 10 | "total_producer_vote_weight": 36311527546260150000, 11 | "last_producer_schedule_size": 21, 12 | "thresh_activated_stake_time": 1531289460000000, 13 | "total_activated_stake": 3383776060389, 14 | "total_unpaid_blocks": 4634153, 15 | "perblock_bucket": 1893164538, 16 | "pervote_bucket": 642337446, 17 | "last_pervote_bucket_fill": 1537388701500000, 18 | "last_producer_schedule_update": "2037-06-08T21:17:24", 19 | "total_ram_stake": 4051971207, 20 | "total_ram_bytes_reserved": 20206032555, 21 | "max_ram_size": 77276670976, 22 | "max_authority_depth": 6, 23 | "max_inline_action_depth": 4, 24 | "max_inline_action_size": 4096, 25 | "max_transaction_delay": 3888000, 26 | "deferred_trx_expiration_window": 600, 27 | "max_transaction_lifetime": 3600, 28 | "min_transaction_cpu_usage": 100, 29 | "max_transaction_cpu_usage": 150000, 30 | "target_block_cpu_usage_pct": 1000, 31 | "max_block_cpu_usage": 200000, 32 | "context_free_discount_net_usage_den": 100, 33 | "context_free_discount_net_usage_num": 20, 34 | "net_usage_leeway": 500, 35 | "base_per_transaction_net_usage": 12, 36 | "max_transaction_net_usage": 524288, 37 | "target_block_net_usage_pct": 1000, 38 | "max_block_net_usage": 1048576 39 | } 40 | } 41 | } --------------------------------------------------------------------------------