@glitterprotocol/glitter-sdk
Version:
The JavaScript SDK for Glitter
90 lines • 3.15 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LCDClient = void 0;
var APIRequester_1 = require("./APIRequester");
var api_1 = require("./api");
var Db_1 = require("./Db");
var DatasetAPI_1 = require("./api/DatasetAPI");
var DEFAULT_LCD_OPTIONS = {
gasAdjustment: 1.75,
};
// isClassic network: true
// forked network : false
var DEFAULT_NETWORK_TYPE_BY_CHAIN_ID = {
default: false,
'columbus-5': true,
'bombay-12': true,
'pisco-1': false,
};
var DEFAULT_GAS_PRICES_BY_CHAIN_ID = {
default: {
uluna: 0.15,
},
'columbus-5': {
uusd: 0.15,
},
'bombay-12': {
uusd: 0.15,
},
'pisco-1': {
uluna: 0.15,
},
};
/**
* An object repesenting a connection to a glittered node running the Lite Client Daemon (LCD)
* server, a REST server providing access to a node.
*/
var LCDClient = /** @class */ (function () {
// public ibc: IbcAPI;
// public ibcTransfer: IbcTransferAPI;
// public utils: LCDUtils;
/**
* Creates a new LCD client with the specified configuration.
*
* @param config LCD configuration
*/
function LCDClient(config) {
this.config = __assign(__assign(__assign({}, DEFAULT_LCD_OPTIONS), { gasPrices: DEFAULT_GAS_PRICES_BY_CHAIN_ID[config.chainID] ||
DEFAULT_GAS_PRICES_BY_CHAIN_ID['default'], isClassic: DEFAULT_NETWORK_TYPE_BY_CHAIN_ID[config.chainID] ||
DEFAULT_NETWORK_TYPE_BY_CHAIN_ID['default'] }), config);
this.apiRequester = new APIRequester_1.APIRequester(this.config.URL);
// instantiate APIs
this.auth = new api_1.AuthAPI(this);
this.bank = new api_1.BankAPI(this);
this.dataset = new DatasetAPI_1.DatasetAPI(this);
// this.distribution = new DistributionAPI(this);
// this.feeGrant = new FeeGrantAPI(this);
// this.gov = new GovAPI(this);
// this.market = new MarketAPI(this);
// this.mint = new MintAPI(this);
// this.authz = new AuthzAPI(this);
// this.oracle = new OracleAPI(this);
// this.slashing = new SlashingAPI(this);
// this.staking = new StakingAPI(this);
this.tendermint = new api_1.TendermintAPI(this);
// this.treasury = new TreasuryAPI(this);
// this.wasm = new WasmAPI(this);
// this.ibc = new IbcAPI(this);
// this.ibcTransfer = new IbcTransferAPI(this);
this.tx = new api_1.TxAPI(this);
// this.utils = new LCDUtils(this);
}
/** Creates a new Db with the Key. */
LCDClient.prototype.db = function (key) {
return new Db_1.Db(this, key);
};
return LCDClient;
}());
exports.LCDClient = LCDClient;
//# sourceMappingURL=LCDClient.js.map