@mysten/sui
Version:
Sui TypeScript API(Work in Progress)
46 lines (45 loc) • 1.65 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var client_exports = {};
__export(client_exports, {
Experimental_BaseClient: () => Experimental_BaseClient
});
module.exports = __toCommonJS(client_exports);
var import_cache = require("./cache.js");
class Experimental_BaseClient {
constructor({ network }) {
this.cache = new import_cache.ClientCache();
this.network = network;
}
$extend(...registrations) {
return Object.create(
this,
Object.fromEntries(
registrations.map((registration) => {
if ("experimental_asClientExtension" in registration) {
const { name, register } = registration.experimental_asClientExtension();
return [name, { value: register(this) }];
}
return [registration.name, { value: registration.register(this) }];
})
)
);
}
}
//# sourceMappingURL=client.js.map
;