@venly/venly-core-sdk
Version:
Javascrip/Typescript SDK for Venly's Web3 Services
57 lines • 2.65 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Venly = void 0;
const api = __importStar(require("./api/index"));
const core_1 = require("./core");
const json_1 = require("./helpers/json");
const json_custom_convert_1 = require("./helpers/json/json-custom-convert");
const models_1 = require("./models");
class Venly {
static get isInitialized() { return Venly._isInitialized; }
static get currentEnvironment() { return Venly._currentEnvironment; }
static get Auth() { return Venly._authApi; }
static get Wallet() { return Venly._walletApi; }
static get Token() { return Venly._tokenApi; }
static get Pay() { return Venly._payApi; }
static initialize(clientId, clientSecret, env = models_1.VyEnvironment.Sandbox) {
json_1.JsonConvert.addGlobalConverter(Date, json_custom_convert_1.VyDateJsonConverter);
json_1.JsonConvert.addGlobalConverter(BigInt, json_custom_convert_1.VyBigIntConverter);
this._isInitialized = true;
this._currentEnvironment = env;
this._provider = new core_1.DefaultServerProvider(clientId, clientSecret);
this._apiBase = new api.VyApiBase(this._provider);
//APIs
this._authApi = new api.VyAuthAPI(this._apiBase);
this._walletApi = new api.VyWalletAPI(this._apiBase);
this._tokenApi = new api.VyTokenAPI(this._apiBase);
this._payApi = new api.VyPayAPI(this._apiBase);
}
}
exports.Venly = Venly;
Venly._currentEnvironment = models_1.VyEnvironment.Sandbox;
Venly._isInitialized = false;
Venly._provider = null;
//# sourceMappingURL=VenlyAPI.js.map