@orbs-network/spot-sdk 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ export interface SpotConfig {
2
+ apiKey?: string;
3
+ debug?: boolean;
4
+ }
5
+ export interface SpotEvent {
6
+ type: string;
7
+ payload: Record<string, unknown>;
8
+ timestamp: number;
9
+ }
10
+ export declare class Spot {
11
+ private config;
12
+ private events;
13
+ constructor(config?: SpotConfig);
14
+ track(type: string, payload?: Record<string, unknown>): SpotEvent;
15
+ getEvents(): SpotEvent[];
16
+ clearEvents(): void;
17
+ getConfig(): SpotConfig;
18
+ }
19
+ export declare function createSpot(config?: SpotConfig): Spot;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,IAAI;IACf,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,MAAM,CAAkB;gBAEpB,MAAM,GAAE,UAAe;IAOnC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,SAAS;IAarE,SAAS,IAAI,SAAS,EAAE;IAIxB,WAAW,IAAI,IAAI;IAInB,SAAS,IAAI,UAAU;CAGxB;AAGD,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAEpD"}
@@ -0,0 +1,34 @@
1
+ var s = Object.defineProperty;
2
+ var c = (e, t, n) => t in e ? s(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var i = (e, t, n) => c(e, typeof t != "symbol" ? t + "" : t, n);
4
+ class r {
5
+ constructor(t = {}) {
6
+ i(this, "config");
7
+ i(this, "events", []);
8
+ this.config = t, this.config.debug && console.log("[Spot] Initialized with config:", t);
9
+ }
10
+ track(t, n = {}) {
11
+ const o = {
12
+ type: t,
13
+ payload: n,
14
+ timestamp: Date.now()
15
+ };
16
+ return this.events.push(o), this.config.debug && console.log("[Spot] Event tracked:", o), o;
17
+ }
18
+ getEvents() {
19
+ return [...this.events];
20
+ }
21
+ clearEvents() {
22
+ this.events = [];
23
+ }
24
+ getConfig() {
25
+ return { ...this.config };
26
+ }
27
+ }
28
+ function f(e) {
29
+ return new r(e);
30
+ }
31
+ export {
32
+ r as Spot,
33
+ f as createSpot
34
+ };
@@ -0,0 +1 @@
1
+ (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.SpotSDK={}))})(this,(function(t){"use strict";var r=Object.defineProperty;var u=(t,e,n)=>e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var s=(t,e,n)=>u(t,typeof e!="symbol"?e+"":e,n);class e{constructor(o={}){s(this,"config");s(this,"events",[]);this.config=o,this.config.debug&&console.log("[Spot] Initialized with config:",o)}track(o,f={}){const i={type:o,payload:f,timestamp:Date.now()};return this.events.push(i),this.config.debug&&console.log("[Spot] Event tracked:",i),i}getEvents(){return[...this.events]}clearEvents(){this.events=[]}getConfig(){return{...this.config}}}function n(c){return new e(c)}t.Spot=e,t.createSpot=n,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@orbs-network/spot-sdk",
3
+ "version": "0.0.2",
4
+ "description": "Spot SDK",
5
+ "type": "module",
6
+ "main": "./dist/spot-sdk.umd.cjs",
7
+ "module": "./dist/spot-sdk.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/spot-sdk.js",
13
+ "require": "./dist/spot-sdk.umd.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "keywords": [
20
+ "spot",
21
+ "sdk"
22
+ ],
23
+ "license": "MIT",
24
+ "devDependencies": {
25
+ "typescript": "^5.7.2",
26
+ "vite": "^6.0.5",
27
+ "vite-plugin-dts": "^4.4.0"
28
+ },
29
+ "scripts": {
30
+ "dev": "vite build --watch",
31
+ "build": "tsc && vite build"
32
+ }
33
+ }