@eoscafe/light-api
Advanced tools
Comparing version 3.2.13 to 3.2.15
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// TypeScript Definitions | ||
__exportStar(require("./src/types/api"), exports); | ||
// Light API | ||
__exportStar(require("./src/jsonrpc"), exports); | ||
__exportStar(require("./src/endpoints"), exports); | ||
__exportStar(require("./src/rpcerror"), exports); | ||
__export(require("./src/jsonrpc")); | ||
__export(require("./src/endpoints")); | ||
__export(require("./src/rpcerror")); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GET_TOKEN_HOLDER_COUNT = exports.GET_CODEHASH = exports.GET_TOPSTAKE = exports.GET_TOPRAM = exports.GET_USERCOUNT = exports.GET_TOPHOLDERS = exports.GET_TOKEN_BALANCE = exports.GET_SYNC_INFO = exports.GET_NETWORKS = exports.GET_KEY_ACCOUNTS = exports.GET_BALANCES = exports.GET_ACCOUNT_INFO = exports.GET_ACCOUNT = void 0; | ||
exports.GET_ACCOUNT = "/api/account"; | ||
@@ -5,0 +4,0 @@ exports.GET_ACCOUNT_INFO = "/api/accinfo"; |
@@ -1,2 +0,2 @@ | ||
import { GetAccount, GetBalances, GetKeyAccounts, GetNetworks, GetTopHolders, GetTopRam, GetTopStake, GetCodehash, GetAccountInfo } from "./types/api"; | ||
import { GetAccount, GetBalances, GetKeyAccounts, GetCodehash, GetAccountInfo } from "./types/api"; | ||
export declare type Fetch = (url: string | Request, init?: RequestInit) => Promise<Response>; | ||
@@ -62,6 +62,15 @@ /** | ||
* @param {string} key public key | ||
* @returns {Promise<GetKeyAccounts>} accounts | ||
* @returns {Promise<GetKeyAccounts[]>} accounts per network | ||
*/ | ||
get_key_accounts(key: string): Promise<GetKeyAccounts[]>; | ||
/** | ||
* [GET /api/key] | ||
* | ||
* Retrieve all accounts in network | ||
* | ||
* @param {string} key public key | ||
* @returns {Promise<GetKeyAccounts>} accounts | ||
*/ | ||
get_network_key_accounts(key: string): Promise<GetKeyAccounts>; | ||
/** | ||
* [GET /api/networks] | ||
@@ -73,3 +82,3 @@ * | ||
*/ | ||
get_networks(): Promise<GetNetworks>; | ||
get_networks(): Promise<import("./types/common").ChainInfo[]>; | ||
/** | ||
@@ -105,3 +114,3 @@ * [GET /api/sync] | ||
*/ | ||
get_topholders(contract: string, token: string, num: number): Promise<GetTopHolders>; | ||
get_topholders(contract: string, token: string, num: number): Promise<string[][]>; | ||
/** | ||
@@ -124,3 +133,3 @@ * [GET /api/usercount] | ||
*/ | ||
get_topram(num: number): Promise<GetTopRam>; | ||
get_topram(num: number): Promise<(string | number)[][]>; | ||
/** | ||
@@ -135,3 +144,3 @@ * [GET /api/topstake] | ||
*/ | ||
get_topstake(num: number): Promise<GetTopStake>; | ||
get_topstake(num: number): Promise<(string | number)[][]>; | ||
/** | ||
@@ -138,0 +147,0 @@ * [GET /api/codehash] |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -39,3 +38,2 @@ }); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JsonRpc = void 0; | ||
var endpoints_1 = require("./endpoints"); | ||
@@ -49,3 +47,3 @@ var rpcerror_1 = require("./rpcerror"); | ||
instar: "https://lightapi.eosamsterdam.net", | ||
proton: "https://lightapi.eosamsterdam.net", | ||
proton: "https://proton.light-api.net", | ||
wax: "https://lightapi.eosamsterdam.net", | ||
@@ -186,3 +184,3 @@ worbli: "https://lightapi.eosamsterdam.net", | ||
* @param {string} key public key | ||
* @returns {Promise<GetKeyAccounts>} accounts | ||
* @returns {Promise<GetKeyAccounts[]>} accounts per network | ||
*/ | ||
@@ -207,2 +205,19 @@ JsonRpc.prototype.get_key_accounts = function (key) { | ||
/** | ||
* [GET /api/key] | ||
* | ||
* Retrieve all accounts in network | ||
* | ||
* @param {string} key public key | ||
* @returns {Promise<GetKeyAccounts>} accounts | ||
*/ | ||
JsonRpc.prototype.get_network_key_accounts = function (key) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var url; | ||
return __generator(this, function (_a) { | ||
url = endpoints_1.GET_KEY_ACCOUNTS + "/" + key; | ||
return [2 /*return*/, this.get(url)]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* [GET /api/networks] | ||
@@ -209,0 +224,0 @@ * |
@@ -6,3 +6,3 @@ "use strict"; | ||
({ __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]; }; | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -17,3 +17,2 @@ }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RpcStatusError = exports.RpcError = void 0; | ||
/** | ||
@@ -20,0 +19,0 @@ * @private |
{ | ||
"name": "@eoscafe/light-api", | ||
"version": "3.2.13", | ||
"version": "3.2.15", | ||
"description": "Light API HTTP Javascript library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
730
51057