DIST
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.idea
|
||||
.vscode
|
||||
.DS_Store
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare class UniCoreMnemonicParseError extends Error {
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.UniCoreMnemonicParseError = void 0;
|
||||
class UniCoreMnemonicParseError extends Error {
|
||||
}
|
||||
exports.UniCoreMnemonicParseError = UniCoreMnemonicParseError;
|
||||
//# sourceMappingURL=errors.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../ts/src/auth/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,yBAA0B,SAAQ,KAAK;CAAG;AAAvD,8DAAuD"}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
export declare const makePublicKeyByMnemonic: (mnemonic: string) => Promise<any>;
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.makePublicKeyByMnemonic = void 0;
|
||||
const ono_1 = __importDefault(require("@jsdevtools/ono"));
|
||||
const errors_1 = require("./errors");
|
||||
const bip39_1 = require("./keys/bip39");
|
||||
const hdkey_1 = require("./keys/hdkey");
|
||||
const ecc_1 = require("./keys/ecc");
|
||||
const makePublicKeyByMnemonic = async (mnemonic) => {
|
||||
if (!(0, bip39_1.isValidMnemonic)(mnemonic)) {
|
||||
throw (0, ono_1.default)(new errors_1.UniCoreMnemonicParseError('Invalid mnemonic'));
|
||||
}
|
||||
const seed = await (0, bip39_1.mnemonicToSeed)(mnemonic);
|
||||
const hdBase = (0, hdkey_1.seedToHd)(seed);
|
||||
const hdFirstNode = (0, hdkey_1.hdToFirstHdNode)(hdBase);
|
||||
const hdPublicKeyBuffer = (0, hdkey_1.hdNodeToPublicKeyBuffer)(hdFirstNode);
|
||||
return (0, ecc_1.hdPublicToEccPublicKey)(hdPublicKeyBuffer);
|
||||
};
|
||||
exports.makePublicKeyByMnemonic = makePublicKeyByMnemonic;
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/src/auth/index.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AAEjC,qCAAoD;AACpD,wCAA8D;AAC9D,wCAAiF;AACjF,oCAAmD;AAE5C,MAAM,uBAAuB,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;IAChE,IAAI,CAAC,IAAA,uBAAe,EAAC,QAAQ,CAAC,EAAE;QAC9B,MAAM,IAAA,aAAG,EAAC,IAAI,kCAAyB,CAAC,kBAAkB,CAAC,CAAC,CAAA;KAC7D;IAED,MAAM,IAAI,GAAG,MAAM,IAAA,sBAAc,EAAC,QAAQ,CAAC,CAAA;IAC3C,MAAM,MAAM,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,WAAW,GAAG,IAAA,uBAAe,EAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,iBAAiB,GAAG,IAAA,+BAAuB,EAAC,WAAW,CAAC,CAAA;IAE9D,OAAO,IAAA,4BAAsB,EAAC,iBAAiB,CAAC,CAAA;AAClD,CAAC,CAAA;AAXY,QAAA,uBAAuB,2BAWnC"}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export declare const isValidMnemonic: (mnemonic: string) => any;
|
||||
export declare const mnemonicToSeed: (mnemonic: string) => any;
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.mnemonicToSeed = exports.isValidMnemonic = void 0;
|
||||
const bip39_1 = require("bip39");
|
||||
const isValidMnemonic = (mnemonic) => (0, bip39_1.validateMnemonic)(mnemonic);
|
||||
exports.isValidMnemonic = isValidMnemonic;
|
||||
const mnemonicToSeed = (mnemonic) => (0, bip39_1.mnemonicToSeed)(mnemonic).then((seed) => seed.toString('hex'));
|
||||
exports.mnemonicToSeed = mnemonicToSeed;
|
||||
//# sourceMappingURL=bip39.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bip39.js","sourceRoot":"","sources":["../../../../ts/src/auth/keys/bip39.ts"],"names":[],"mappings":";;;AAAA,iCAA+E;AAExE,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAA,wBAAgB,EAAC,QAAQ,CAAC,CAAA;AAAlE,QAAA,eAAe,mBAAmD;AAExE,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE,CACjD,IAAA,sBAAmB,EAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;AAD/D,QAAA,cAAc,kBACiD"}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
/// <reference types="node" />
|
||||
import { PrivateKey } from 'eosjs/dist/eosjs-jssig';
|
||||
export declare const isValidWif: (wif: string) => boolean;
|
||||
export declare const wifToPrivateKey: (wif: string) => PrivateKey;
|
||||
export declare const privateKeyToPublic: (privateKey: PrivateKey) => import("eosjs/dist/PublicKey").PublicKey;
|
||||
export declare const hdPublicToEccPublicKey: (hdPublicKey: string | Buffer) => any;
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hdPublicToEccPublicKey = exports.privateKeyToPublic = exports.wifToPrivateKey = exports.isValidWif = void 0;
|
||||
const eosjs_ecc_migration_1 = require("eosjs/dist/eosjs-ecc-migration");
|
||||
const eosjs_jssig_1 = require("eosjs/dist/eosjs-jssig");
|
||||
const eosjs_ecc_1 = __importDefault(require("eosjs-ecc"));
|
||||
const isValidWif = (wif) => eosjs_ecc_migration_1.ecc.isValidPrivate(wif);
|
||||
exports.isValidWif = isValidWif;
|
||||
const wifToPrivateKey = (wif) => eosjs_jssig_1.PrivateKey.fromString(wif);
|
||||
exports.wifToPrivateKey = wifToPrivateKey;
|
||||
const privateKeyToPublic = (privateKey) => privateKey.getPublicKey();
|
||||
exports.privateKeyToPublic = privateKeyToPublic;
|
||||
const hdPublicToEccPublicKey = (hdPublicKey) => eosjs_ecc_1.default.PublicKey(hdPublicKey).toString();
|
||||
exports.hdPublicToEccPublicKey = hdPublicToEccPublicKey;
|
||||
//# sourceMappingURL=ecc.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ecc.js","sourceRoot":"","sources":["../../../../ts/src/auth/keys/ecc.ts"],"names":[],"mappings":";;;;;;AAAA,wEAAoD;AACpD,wDAAmD;AACnD,0DAA2B;AAEpB,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,yBAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAA;AAArD,QAAA,UAAU,cAA2C;AAE3D,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,wBAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAA7D,QAAA,eAAe,mBAA8C;AAEnE,MAAM,kBAAkB,GAAG,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE,CAAA;AAA1E,QAAA,kBAAkB,sBAAwD;AAEhF,MAAM,sBAAsB,GAAG,CAAC,WAA4B,EAAE,EAAE,CACrE,mBAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAA;AAD1B,QAAA,sBAAsB,0BACI"}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
/// <reference types="node" />
|
||||
import hdkey from 'hdkey';
|
||||
import { Buffer } from 'buffer';
|
||||
export declare const seedToHd: (seed: string | Buffer) => hdkey;
|
||||
export declare const hdToFirstHdNode: (hd: hdkey) => hdkey;
|
||||
export declare const hdNodeToPublicKeyBuffer: (hd: hdkey) => Buffer;
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hdNodeToPublicKeyBuffer = exports.hdToFirstHdNode = exports.seedToHd = void 0;
|
||||
const hdkey_1 = __importDefault(require("hdkey"));
|
||||
const buffer_1 = require("buffer");
|
||||
const seedToHd = (seed) => {
|
||||
const isString = typeof seed === 'string';
|
||||
const seedBuffer = isString ? buffer_1.Buffer.from(seed, 'hex') : seed;
|
||||
return hdkey_1.default.fromMasterSeed(seedBuffer);
|
||||
};
|
||||
exports.seedToHd = seedToHd;
|
||||
const hdToFirstHdNode = (hd) => hd.derive("m/44'/194'/0'/0/0");
|
||||
exports.hdToFirstHdNode = hdToFirstHdNode;
|
||||
const hdNodeToPublicKeyBuffer = (hd) => hd.publicKey;
|
||||
exports.hdNodeToPublicKeyBuffer = hdNodeToPublicKeyBuffer;
|
||||
//# sourceMappingURL=hdkey.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hdkey.js","sourceRoot":"","sources":["../../../../ts/src/auth/keys/hdkey.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,mCAA+B;AAExB,MAAM,QAAQ,GAAG,CAAC,IAAqB,EAAE,EAAE;IAChD,MAAM,QAAQ,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAA;IACzC,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAE7D,OAAO,eAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;AACzC,CAAC,CAAA;AALY,QAAA,QAAQ,YAKpB;AAEM,MAAM,eAAe,GAAG,CAAC,EAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAA/D,QAAA,eAAe,mBAAgD;AAErE,MAAM,uBAAuB,GAAG,CAAC,EAAS,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;AAArD,QAAA,uBAAuB,2BAA8B"}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
import EosioContract from './contracts/eosio';
|
||||
import CoreContract from './contracts/core';
|
||||
import PartnersContract from './contracts/partners';
|
||||
import { ChainConfig, TableCodeConfig } from './types';
|
||||
import ReadApi from './readApi';
|
||||
import BaseContract from "./contracts/base";
|
||||
declare class Chain {
|
||||
private readonly name;
|
||||
readApi: ReadApi;
|
||||
private readonly tableCodeConfig;
|
||||
eosioContract: EosioContract;
|
||||
coreContract: CoreContract;
|
||||
partnersContract: PartnersContract;
|
||||
constructor(chainConfig: ChainConfig, tableCodeConfig: TableCodeConfig);
|
||||
applyContract<T extends BaseContract>(contract: {
|
||||
new (...args: any[]): T;
|
||||
}): T;
|
||||
}
|
||||
export default Chain;
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const eosio_1 = __importDefault(require("./contracts/eosio"));
|
||||
const core_1 = __importDefault(require("./contracts/core"));
|
||||
const partners_1 = __importDefault(require("./contracts/partners"));
|
||||
const readApi_1 = __importDefault(require("./readApi"));
|
||||
class Chain {
|
||||
constructor(chainConfig, tableCodeConfig) {
|
||||
this.name = chainConfig.name;
|
||||
this.tableCodeConfig = { ...tableCodeConfig, ...(chainConfig.tableCodeConfigOverride || {}) };
|
||||
this.readApi = new readApi_1.default(this.name, chainConfig.rpcEndpoints, chainConfig.balancingMode);
|
||||
this.eosioContract = this.applyContract(eosio_1.default);
|
||||
this.coreContract = this.applyContract(core_1.default);
|
||||
this.partnersContract = this.applyContract(partners_1.default);
|
||||
}
|
||||
applyContract(contract) {
|
||||
return new contract(this.readApi, this.tableCodeConfig);
|
||||
}
|
||||
}
|
||||
exports.default = Chain;
|
||||
//# sourceMappingURL=chain.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../ts/src/blockchain/chain.ts"],"names":[],"mappings":";;;;;AAAA,8DAA6C;AAC7C,4DAA2C;AAC3C,oEAAmD;AAEnD,wDAA+B;AAG/B,MAAM,KAAK;IAST,YAAY,WAAwB,EAAE,eAAgC;QACpE,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAA;QAC5B,IAAI,CAAC,eAAe,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,CAAC,WAAW,CAAC,uBAAuB,IAAI,EAAE,CAAC,EAAE,CAAA;QAC7F,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;QAE1F,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,eAAa,CAAC,CAAA;QACtD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,cAAY,CAAC,CAAA;QACpD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,kBAAgB,CAAC,CAAA;IAC9D,CAAC;IAED,aAAa,CAAyB,QAAqC;QACzE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAA;IACzD,CAAC;CACF;AAED,kBAAe,KAAK,CAAA"}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import Chain from './chain';
|
||||
import { Config } from './types';
|
||||
declare class ChainsSingleton {
|
||||
private readonly chainsByName;
|
||||
private initialized;
|
||||
private rootChain;
|
||||
constructor();
|
||||
init(config: Config): void;
|
||||
checkChainsIsInitialized(): void;
|
||||
getChainByName(name: string): Chain;
|
||||
getRootChain(): Chain;
|
||||
}
|
||||
export default ChainsSingleton;
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const ono_1 = __importDefault(require("@jsdevtools/ono"));
|
||||
const chain_1 = __importDefault(require("./chain"));
|
||||
const errors_1 = require("./errors");
|
||||
class ChainsSingleton {
|
||||
constructor() {
|
||||
this.chainsByName = {};
|
||||
this.initialized = false;
|
||||
this.rootChain = 'unknown';
|
||||
}
|
||||
init(config) {
|
||||
if (this.initialized) {
|
||||
return;
|
||||
}
|
||||
for (const chain of config.chains) {
|
||||
this.chainsByName[chain.name] = new chain_1.default(chain, config.tableCodeConfig);
|
||||
}
|
||||
this.rootChain = config.ual.rootChain;
|
||||
this.initialized = true;
|
||||
}
|
||||
checkChainsIsInitialized() {
|
||||
if (!this.initialized) {
|
||||
throw (0, ono_1.default)(new errors_1.ChainsIsNotInitializedError('Chains is not initialized'));
|
||||
}
|
||||
}
|
||||
getChainByName(name) {
|
||||
this.checkChainsIsInitialized();
|
||||
const chain = this.chainsByName[name];
|
||||
if (!chain) {
|
||||
throw (0, ono_1.default)(new errors_1.UnknownChainError(`Chain "${name}" not found`));
|
||||
}
|
||||
return chain;
|
||||
}
|
||||
getRootChain() {
|
||||
return this.getChainByName(this.rootChain);
|
||||
}
|
||||
}
|
||||
exports.default = ChainsSingleton;
|
||||
//# sourceMappingURL=chainsSingleton.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"chainsSingleton.js","sourceRoot":"","sources":["../../../ts/src/blockchain/chainsSingleton.ts"],"names":[],"mappings":";;;;;AAAA,0DAAiC;AAEjC,oDAA2B;AAE3B,qCAAyE;AAOzE,MAAM,eAAe;IAKnB;QACE,IAAI,CAAC,YAAY,GAAG,EAAE,CAAA;QACtB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAA;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAM;SACP;QAED,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE;YACjC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,eAAK,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAA;SACzE;QAED,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAA;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;IACzB,CAAC;IAED,wBAAwB;QACtB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACrB,MAAM,IAAA,aAAG,EAAC,IAAI,oCAA2B,CAAC,2BAA2B,CAAC,CAAC,CAAA;SACxE;IACH,CAAC;IAED,cAAc,CAAC,IAAY;QACzB,IAAI,CAAC,wBAAwB,EAAE,CAAA;QAE/B,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QAErC,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAA,aAAG,EAAC,IAAI,0BAAiB,CAAC,UAAU,IAAI,aAAa,CAAC,CAAC,CAAA;SAC9D;QAED,OAAO,KAAK,CAAA;IACd,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC5C,CAAC;CACF;AAED,kBAAe,eAAe,CAAA"}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import ReadApi from '../readApi';
|
||||
import { TableCodeConfig } from '../types';
|
||||
interface TableRowsArgs {
|
||||
scope?: string;
|
||||
table: string;
|
||||
table_key?: string;
|
||||
lower_bound?: number | string;
|
||||
upper_bound?: number | string;
|
||||
limit?: number;
|
||||
key_type?: string;
|
||||
index_position?: number;
|
||||
parseMetaAsJson?: boolean;
|
||||
}
|
||||
declare class BaseContract {
|
||||
private api;
|
||||
private readonly name;
|
||||
constructor(api: ReadApi, tableCodeConfig: TableCodeConfig, name: string);
|
||||
getTableRows<ReturnType>({ scope, table, table_key, lower_bound, upper_bound, limit, key_type, index_position, parseMetaAsJson, }: TableRowsArgs): Promise<import("../../eos/types").TableResult<ReturnType>>;
|
||||
getSingleTableRow<ReturnType>(args: TableRowsArgs): Promise<ReturnType>;
|
||||
}
|
||||
export default BaseContract;
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class BaseContract {
|
||||
constructor(api, tableCodeConfig, name) {
|
||||
this.api = api;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
this.name = tableCodeConfig[name] || name;
|
||||
}
|
||||
async getTableRows({ scope, table, table_key, lower_bound, upper_bound, limit, key_type, index_position, parseMetaAsJson, }) {
|
||||
const result = await this.api.getTableRows(this.name, scope || this.name, table, table_key, lower_bound, upper_bound, limit, key_type, index_position);
|
||||
if (parseMetaAsJson && result.rows) {
|
||||
for (const row of result.rows) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
if (!row.meta) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
row.meta = {};
|
||||
}
|
||||
else {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
row.meta = JSON.parse(row.meta);
|
||||
}
|
||||
catch (_) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
row.meta = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
async getSingleTableRow(args) {
|
||||
const result = await this.getTableRows(args);
|
||||
return result.rows[0];
|
||||
}
|
||||
}
|
||||
exports.default = BaseContract;
|
||||
//# sourceMappingURL=base.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../ts/src/blockchain/contracts/base.ts"],"names":[],"mappings":";;AAeA,MAAM,YAAY;IAIhB,YAAY,GAAY,EAAE,eAAgC,EAAE,IAAY;QACtE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,6DAA6D;QAC7D,aAAa;QACb,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,IAAI,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,YAAY,CAAa,EAC7B,KAAK,EACL,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,KAAK,EACL,QAAQ,EACR,cAAc,EACd,eAAe,GACD;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,YAAY,CACxC,IAAI,CAAC,IAAI,EACT,KAAK,IAAI,IAAI,CAAC,IAAI,EAClB,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,KAAK,EACL,QAAQ,EACR,cAAc,CACf,CAAA;QAED,IAAI,eAAe,IAAI,MAAM,CAAC,IAAI,EAAE;YAClC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE;gBAC7B,6DAA6D;gBAC7D,aAAa;gBACb,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;oBACb,6DAA6D;oBAC7D,aAAa;oBACb,GAAG,CAAC,IAAI,GAAG,EAAE,CAAA;iBACd;qBAAM;oBACL,IAAI;wBACF,6DAA6D;wBAC7D,aAAa;wBACb,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;qBAChC;oBAAC,OAAO,CAAC,EAAE;wBACV,6DAA6D;wBAC7D,aAAa;wBACb,GAAG,CAAC,IAAI,GAAG,EAAE,CAAA;qBACd;iBACF;aACF;SACF;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAa,IAAmB;QACrD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAa,IAAI,CAAC,CAAA;QAExD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACvB,CAAC;CACF;AAED,kBAAe,YAAY,CAAA"}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import ReadApi from '../readApi';
|
||||
import { TableCodeConfig } from '../types';
|
||||
import BaseContract from './base';
|
||||
declare class CoreContract extends BaseContract {
|
||||
constructor(api: ReadApi, tableCodeConfig: TableCodeConfig);
|
||||
}
|
||||
export default CoreContract;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const base_1 = __importDefault(require("./base"));
|
||||
class CoreContract extends base_1.default {
|
||||
constructor(api, tableCodeConfig) {
|
||||
super(api, tableCodeConfig, 'core');
|
||||
}
|
||||
}
|
||||
exports.default = CoreContract;
|
||||
//# sourceMappingURL=core.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../ts/src/blockchain/contracts/core.ts"],"names":[],"mappings":";;;;;AAEA,kDAAiC;AAEjC,MAAM,YAAa,SAAQ,cAAY;IACrC,YAAY,GAAY,EAAE,eAAgC;QACxD,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,CAAC,CAAA;IACrC,CAAC;CACF;AAED,kBAAe,YAAY,CAAA"}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
import ReadApi from '../readApi';
|
||||
import { TableCodeConfig } from '../types';
|
||||
import BaseContract from './base';
|
||||
interface EosioGlobalData {
|
||||
base_per_transaction_net_usage: number;
|
||||
context_free_discount_net_usage_den: number;
|
||||
context_free_discount_net_usage_num: number;
|
||||
deferred_trx_expiration_window: number;
|
||||
last_name_close: string;
|
||||
last_pervote_bucket_fill: string;
|
||||
last_producer_schedule_size: number;
|
||||
last_producer_schedule_update: string;
|
||||
max_authority_depth: number;
|
||||
max_block_cpu_usage: number;
|
||||
max_block_net_usage: number;
|
||||
max_inline_action_depth: number;
|
||||
max_inline_action_size: number;
|
||||
max_ram_size: string;
|
||||
max_transaction_cpu_usage: number;
|
||||
max_transaction_delay: number;
|
||||
max_transaction_lifetime: number;
|
||||
max_transaction_net_usage: number;
|
||||
min_transaction_cpu_usage: number;
|
||||
net_usage_leeway: number;
|
||||
perblock_bucket: string;
|
||||
pervote_bucket: string;
|
||||
target_block_cpu_usage_pct: number;
|
||||
target_block_net_usage_pct: number;
|
||||
thresh_activated_stake_time: string;
|
||||
total_activated_stake: number;
|
||||
total_producer_vote_weight: string;
|
||||
total_ram_bytes_reserved: number;
|
||||
total_ram_stake: number;
|
||||
total_unpaid_blocks: number;
|
||||
}
|
||||
declare class EosioContract extends BaseContract {
|
||||
constructor(api: ReadApi, tableCodeConfig: TableCodeConfig);
|
||||
getGlobalData(): Promise<EosioGlobalData>;
|
||||
}
|
||||
export default EosioContract;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const base_1 = __importDefault(require("./base"));
|
||||
class EosioContract extends base_1.default {
|
||||
constructor(api, tableCodeConfig) {
|
||||
super(api, tableCodeConfig, 'eosio');
|
||||
}
|
||||
getGlobalData() {
|
||||
return this.getSingleTableRow({
|
||||
table: 'global',
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.default = EosioContract;
|
||||
//# sourceMappingURL=eosio.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"eosio.js","sourceRoot":"","sources":["../../../../ts/src/blockchain/contracts/eosio.ts"],"names":[],"mappings":";;;;;AAEA,kDAAiC;AAmCjC,MAAM,aAAc,SAAQ,cAAY;IACtC,YAAY,GAAY,EAAE,eAAgC;QACxD,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,CAAC,CAAA;IACtC,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,iBAAiB,CAAkB;YAC7C,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAA;IACJ,CAAC;CACF;AAED,kBAAe,aAAa,CAAA"}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { AccountName } from '../../eos/types';
|
||||
import ReadApi from '../readApi';
|
||||
import { TableCodeConfig } from '../types';
|
||||
import BaseContract from './base';
|
||||
declare class PartnersContract extends BaseContract {
|
||||
constructor(api: ReadApi, tableCodeConfig: TableCodeConfig);
|
||||
getAccountPartner(accountName: AccountName): Promise<any>;
|
||||
}
|
||||
export default PartnersContract;
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const base_1 = __importDefault(require("./base"));
|
||||
class PartnersContract extends base_1.default {
|
||||
constructor(api, tableCodeConfig) {
|
||||
super(api, tableCodeConfig, 'part');
|
||||
}
|
||||
getAccountPartner(accountName) {
|
||||
return this.getSingleTableRow({
|
||||
table: 'partners2',
|
||||
lower_bound: accountName,
|
||||
upper_bound: accountName,
|
||||
limit: 1,
|
||||
parseMetaAsJson: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.default = PartnersContract;
|
||||
//# sourceMappingURL=partners.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"partners.js","sourceRoot":"","sources":["../../../../ts/src/blockchain/contracts/partners.ts"],"names":[],"mappings":";;;;;AAGA,kDAAiC;AAKjC,MAAM,gBAAiB,SAAQ,cAAY;IACzC,YAAY,GAAY,EAAE,eAAgC;QACxD,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,CAAC,CAAA;IACrC,CAAC;IAED,iBAAiB,CAAC,WAAwB;QACxC,OAAO,IAAI,CAAC,iBAAiB,CAAa;YACxC,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,WAAW;YACxB,KAAK,EAAE,CAAC;YACR,eAAe,EAAE,IAAI;SACtB,CAAC,CAAA;IACJ,CAAC;CACF;AAED,kBAAe,gBAAgB,CAAA"}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
export declare class RpcEndpointsEmptyError extends Error {
|
||||
}
|
||||
export declare class UnknownChainError extends Error {
|
||||
}
|
||||
export declare class ChainsIsNotInitializedError extends Error {
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ChainsIsNotInitializedError = exports.UnknownChainError = exports.RpcEndpointsEmptyError = void 0;
|
||||
class RpcEndpointsEmptyError extends Error {
|
||||
}
|
||||
exports.RpcEndpointsEmptyError = RpcEndpointsEmptyError;
|
||||
class UnknownChainError extends Error {
|
||||
}
|
||||
exports.UnknownChainError = UnknownChainError;
|
||||
class ChainsIsNotInitializedError extends Error {
|
||||
}
|
||||
exports.ChainsIsNotInitializedError = ChainsIsNotInitializedError;
|
||||
//# sourceMappingURL=errors.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../ts/src/blockchain/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,sBAAuB,SAAQ,KAAK;CAAG;AAApD,wDAAoD;AAEpD,MAAa,iBAAkB,SAAQ,KAAK;CAAG;AAA/C,8CAA+C;AAE/C,MAAa,2BAA4B,SAAQ,KAAK;CAAG;AAAzD,kEAAyD"}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import EosApi from 'eosjs-api';
|
||||
import { RpcEndpoint, BalancingMode } from './types';
|
||||
declare class ReadApi {
|
||||
private readonly balancingMode;
|
||||
private readonly apis;
|
||||
private offset;
|
||||
constructor(chainName: string, apiConfigs: RpcEndpoint[], balancingMode?: BalancingMode);
|
||||
getInstance(): EosApi;
|
||||
getKeyAccounts: EosApi['getKeyAccounts'];
|
||||
getAccount: EosApi['getAccount'];
|
||||
getTableRows<RowType>(code: string, scope: string, table: string, table_key?: string, lower_bound?: number | string, upper_bound?: number | string, limit?: number, key_type?: string, index_position?: number): import("../eos/types").TableResult<RowType>;
|
||||
}
|
||||
export default ReadApi;
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const eosjs_api_1 = __importDefault(require("eosjs-api"));
|
||||
const ono_1 = __importDefault(require("@jsdevtools/ono"));
|
||||
const errors_1 = require("./errors");
|
||||
class ReadApi {
|
||||
constructor(chainName, apiConfigs, balancingMode) {
|
||||
this.getKeyAccounts = (...args) => {
|
||||
const instance = this.getInstance();
|
||||
return instance.getKeyAccounts(...args);
|
||||
};
|
||||
this.getAccount = (...args) => {
|
||||
const instance = this.getInstance();
|
||||
return instance.getAccount(...args);
|
||||
};
|
||||
this.offset = 0;
|
||||
this.balancingMode = balancingMode || 'random-once';
|
||||
this.apis = [];
|
||||
if (!apiConfigs || apiConfigs.length === 0) {
|
||||
throw (0, ono_1.default)(new errors_1.RpcEndpointsEmptyError(`rpcEndpoints is empty (chain=${chainName})`));
|
||||
}
|
||||
for (const { protocol, host, port } of apiConfigs) {
|
||||
const rpcEndpointString = `${protocol}://${host}:${port}`;
|
||||
this.apis.push(new eosjs_api_1.default({ httpEndpoint: rpcEndpointString }));
|
||||
}
|
||||
if (this.balancingMode === 'random-once' && this.apis.length > 1) {
|
||||
this.offset = Math.floor(Math.random() * this.apis.length);
|
||||
}
|
||||
}
|
||||
getInstance() {
|
||||
if (this.apis.length < 2) {
|
||||
return this.apis[0];
|
||||
}
|
||||
let offset = this.offset;
|
||||
if (this.balancingMode === 'random') {
|
||||
offset = Math.floor(Math.random() * this.apis.length);
|
||||
}
|
||||
const api = this.apis[offset];
|
||||
if (this.balancingMode === 'round-robin') {
|
||||
this.offset++;
|
||||
if (this.offset >= this.apis.length) {
|
||||
this.offset = 0;
|
||||
}
|
||||
}
|
||||
return api;
|
||||
}
|
||||
getTableRows(code, scope, table, table_key, lower_bound, upper_bound, limit, key_type, index_position) {
|
||||
const instance = this.getInstance();
|
||||
return instance.getTableRows(true, code, scope, table, table_key, lower_bound, upper_bound, limit, key_type, index_position);
|
||||
}
|
||||
}
|
||||
exports.default = ReadApi;
|
||||
//# sourceMappingURL=readApi.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"readApi.js","sourceRoot":"","sources":["../../../ts/src/blockchain/readApi.ts"],"names":[],"mappings":";;;;;AAAA,0DAA8B;AAC9B,0DAAiC;AAGjC,qCAAiD;AAEjD,MAAM,OAAO;IAKX,YAAY,SAAiB,EAAE,UAAyB,EAAE,aAA6B;QA0CvF,mBAAc,GAA6B,CAAC,GAAG,IAAI,EAAE,EAAE;YACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;YAEnC,OAAO,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAA;QACzC,CAAC,CAAA;QAED,eAAU,GAAyB,CAAC,GAAG,IAAI,EAAE,EAAE;YAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;YAEnC,OAAO,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAA;QACrC,CAAC,CAAA;QAnDC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;QACf,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,aAAa,CAAA;QACnD,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;QAEd,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,MAAM,IAAA,aAAG,EAAC,IAAI,+BAAsB,CAAC,gCAAgC,SAAS,GAAG,CAAC,CAAC,CAAA;SACpF;QAED,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,UAAU,EAAE;YACjD,MAAM,iBAAiB,GAAG,GAAG,QAAQ,MAAM,IAAI,IAAI,IAAI,EAAE,CAAA;YACzD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,mBAAM,CAAC,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAA;SAChE;QAED,IAAI,IAAI,CAAC,aAAa,KAAK,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAChE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SAC3D;IACH,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;SACpB;QAED,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACxB,IAAI,IAAI,CAAC,aAAa,KAAK,QAAQ,EAAE;YACnC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SACtD;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAE7B,IAAI,IAAI,CAAC,aAAa,KAAK,aAAa,EAAE;YACxC,IAAI,CAAC,MAAM,EAAE,CAAA;YAEb,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBACnC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;aAChB;SACF;QAED,OAAO,GAAG,CAAA;IACZ,CAAC;IAcD,YAAY,CACV,IAAY,EACZ,KAAa,EACb,KAAa,EACb,SAAkB,EAClB,WAA6B,EAC7B,WAA6B,EAC7B,KAAc,EACd,QAAiB,EACjB,cAAuB;QAEvB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;QAEnC,OAAO,QAAQ,CAAC,YAAY,CAC1B,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,KAAK,EACL,QAAQ,EACR,cAAc,CACf,CAAA;IACH,CAAC;CACF;AAED,kBAAe,OAAO,CAAA"}
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
export declare type BalancingMode = 'round-robin' | 'random-once' | 'random';
|
||||
export interface RpcEndpoint {
|
||||
protocol: string;
|
||||
host: string;
|
||||
port: number;
|
||||
}
|
||||
export interface TableCodeConfig {
|
||||
core?: string;
|
||||
staker?: string;
|
||||
p2p?: string;
|
||||
reg?: string;
|
||||
part?: string;
|
||||
}
|
||||
export interface TableCodeConfigStrict {
|
||||
core: string;
|
||||
staker: string;
|
||||
p2p: string;
|
||||
reg: string;
|
||||
part: string;
|
||||
}
|
||||
export interface ChainConfig {
|
||||
name: string;
|
||||
rpcEndpoints: RpcEndpoint[];
|
||||
balancingMode?: BalancingMode;
|
||||
explorerApiUrl: string;
|
||||
tableCodeConfigOverride?: TableCodeConfig;
|
||||
}
|
||||
export interface UalConfig {
|
||||
rootChain: string;
|
||||
}
|
||||
export interface Config {
|
||||
chains: ChainConfig[];
|
||||
ual: UalConfig;
|
||||
tableCodeConfig: TableCodeConfigStrict;
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=types.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../ts/src/blockchain/types.ts"],"names":[],"mappings":""}
|
||||
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
export declare type AccountName = string;
|
||||
export declare type SafeNumber = number | string;
|
||||
export declare type TokenAmount = string;
|
||||
export interface Limit {
|
||||
used: SafeNumber;
|
||||
available: SafeNumber;
|
||||
max: SafeNumber;
|
||||
}
|
||||
export interface AuthKey {
|
||||
key: string;
|
||||
weight: number;
|
||||
}
|
||||
export interface RequiredAuth {
|
||||
accounts: AccountName[];
|
||||
keys: AuthKey[];
|
||||
threshold: number;
|
||||
waits: any[];
|
||||
}
|
||||
export interface Permission {
|
||||
parent?: AccountName;
|
||||
perm_name: string;
|
||||
required_auth: RequiredAuth;
|
||||
}
|
||||
export interface Resources {
|
||||
cpu_weight: TokenAmount;
|
||||
net_weight: TokenAmount;
|
||||
owner: AccountName;
|
||||
ram_bytes: number;
|
||||
}
|
||||
export interface AccountStats {
|
||||
account_name: string;
|
||||
cpu_limit: Limit;
|
||||
cpu_weight: number;
|
||||
created: string;
|
||||
head_block_num: number;
|
||||
head_block_time: string;
|
||||
last_code_update: string;
|
||||
net_limit: Limit;
|
||||
net_weight: number;
|
||||
permissions: Permission[];
|
||||
privileged: boolean;
|
||||
ram_quota: number;
|
||||
ram_usage: number;
|
||||
refund_request: any;
|
||||
rex_info: any;
|
||||
self_delegated_bandwidth: any;
|
||||
subjective_cpu_bill_limit: Limit;
|
||||
total_resources: Resources;
|
||||
voter_info: any;
|
||||
}
|
||||
export interface TableResult<RowType = any> {
|
||||
rows: RowType[];
|
||||
more?: boolean;
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=types.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../ts/src/eos/types.ts"],"names":[],"mappings":""}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
export { makePublicKeyByMnemonic } from './auth';
|
||||
export { default as ChainsSingleton } from './blockchain/chainsSingleton';
|
||||
export { default as ReadApi } from './blockchain/readApi';
|
||||
export { TableCodeConfig } from './blockchain/types';
|
||||
export { default as BaseContract } from './blockchain/contracts/base';
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BaseContract = exports.ReadApi = exports.ChainsSingleton = exports.makePublicKeyByMnemonic = void 0;
|
||||
var auth_1 = require("./auth");
|
||||
Object.defineProperty(exports, "makePublicKeyByMnemonic", { enumerable: true, get: function () { return auth_1.makePublicKeyByMnemonic; } });
|
||||
var chainsSingleton_1 = require("./blockchain/chainsSingleton");
|
||||
Object.defineProperty(exports, "ChainsSingleton", { enumerable: true, get: function () { return __importDefault(chainsSingleton_1).default; } });
|
||||
var readApi_1 = require("./blockchain/readApi");
|
||||
Object.defineProperty(exports, "ReadApi", { enumerable: true, get: function () { return __importDefault(readApi_1).default; } });
|
||||
var base_1 = require("./blockchain/contracts/base");
|
||||
Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return __importDefault(base_1).default; } });
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/src/index.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA8C;AAAtC,+GAAA,uBAAuB,OAAA;AAE/B,gEAAuE;AAA/D,mIAAA,OAAO,OAAmB;AAElC,gDAAuD;AAA/C,mHAAA,OAAO,OAAW;AAE1B,oDAAmE;AAA3D,qHAAA,OAAO,OAAgB"}
|
||||
Reference in New Issue
Block a user