@chainrails/common 0.0.0

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,22 @@
1
+ var e = /* @__PURE__ */ ((T) => (T.ARBITRUM = "ARBITRUM_MAINNET", T.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", T.BASE = "BASE_MAINNET", T.BASE_TESTNET = "BASE_TESTNET", T.AVALANCHE = "AVALANCHE_MAINNET", T.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", T))(e || {}), N = /* @__PURE__ */ ((T) => (T.USDC = "USDC", T))(N || {});
2
+ class E {
3
+ constructor({ api_key: A }) {
4
+ this.api_key = A;
5
+ }
6
+ static config(A) {
7
+ if (!E.app) {
8
+ if (!A)
9
+ throw new Error("Please provide an api_key");
10
+ E.app = new E(A);
11
+ }
12
+ return A && (this.app.api_key = A.api_key), E.app;
13
+ }
14
+ static getApiKey() {
15
+ return E.app.api_key;
16
+ }
17
+ }
18
+ export {
19
+ E as ChainRails,
20
+ e as chains,
21
+ N as tokens
22
+ };
@@ -0,0 +1,22 @@
1
+ var e = /* @__PURE__ */ ((T) => (T.ARBITRUM = "ARBITRUM_MAINNET", T.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", T.BASE = "BASE_MAINNET", T.BASE_TESTNET = "BASE_TESTNET", T.AVALANCHE = "AVALANCHE_MAINNET", T.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", T))(e || {}), N = /* @__PURE__ */ ((T) => (T.USDC = "USDC", T))(N || {});
2
+ class E {
3
+ constructor({ api_key: A }) {
4
+ this.api_key = A;
5
+ }
6
+ static config(A) {
7
+ if (!E.app) {
8
+ if (!A)
9
+ throw new Error("Please provide an api_key");
10
+ E.app = new E(A);
11
+ }
12
+ return A && (this.app.api_key = A.api_key), E.app;
13
+ }
14
+ static getApiKey() {
15
+ return E.app.api_key;
16
+ }
17
+ }
18
+ export {
19
+ E as ChainRails,
20
+ e as chains,
21
+ N as tokens
22
+ };
@@ -0,0 +1 @@
1
+ (function(t,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(t=typeof globalThis<"u"?globalThis:t||self,A(t.Chainrails={}))})(this,(function(t){"use strict";var A=(e=>(e.ARBITRUM="ARBITRUM_MAINNET",e.ARBITRUM_TESTNET="ARBITRUM_TESTNET",e.BASE="BASE_MAINNET",e.BASE_TESTNET="BASE_TESTNET",e.AVALANCHE="AVALANCHE_MAINNET",e.AVALANCHE_TESTNET="AVALANCHE_TESTNET",e))(A||{}),i=(e=>(e.USDC="USDC",e))(i||{});class T{constructor({api_key:E}){this.api_key=E}static config(E){if(!T.app){if(!E)throw new Error("Please provide an api_key");T.app=new T(E)}return E&&(this.app.api_key=E.api_key),T.app}static getApiKey(){return T.app.api_key}}t.ChainRails=T,t.chains=A,t.tokens=i,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,4 @@
1
+ export { chains } from "./src/chains";
2
+ export { tokens } from "./src/tokens";
3
+ export { ChainRails } from "./src/app";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,12 @@
1
+ interface ChainRailsConfig {
2
+ api_key: string;
3
+ }
4
+ export declare class ChainRails {
5
+ private static app;
6
+ api_key: string;
7
+ private constructor();
8
+ static config(props?: ChainRailsConfig): ChainRails;
9
+ static getApiKey(): string;
10
+ }
11
+ export {};
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/index.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAY;IAC9B,OAAO,EAAE,MAAM,CAAA;IAEf,OAAO;WAIO,MAAM,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,UAAU;WAc5C,SAAS,IAAI,MAAM;CAGlC"}
@@ -0,0 +1,9 @@
1
+ export declare enum chains {
2
+ ARBITRUM = "ARBITRUM_MAINNET",
3
+ ARBITRUM_TESTNET = "ARBITRUM_TESTNET",
4
+ BASE = "BASE_MAINNET",
5
+ BASE_TESTNET = "BASE_TESTNET",
6
+ AVALANCHE = "AVALANCHE_MAINNET",
7
+ AVALANCHE_TESTNET = "AVALANCHE_TESTNET"
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chains/index.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM;IAChB,QAAQ,qBAAqB;IAC7B,gBAAgB,qBAAqB;IACrC,IAAI,iBAAiB;IACrB,YAAY,iBAAiB;IAC7B,SAAS,sBAAsB;IAC/B,iBAAiB,sBAAsB;CACxC"}
@@ -0,0 +1,4 @@
1
+ export declare enum tokens {
2
+ USDC = "USDC"
3
+ }
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tokens/index.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM;IAChB,IAAI,SAAS;CACd"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@chainrails/common",
3
+ "sideEffects": false,
4
+ "version": "0.0.0",
5
+ "main": "./dist/chainrails-common.umd.js",
6
+ "module": "./dist/chainrails-common.es.mjs",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/horuslabsio/chainrails-common",
11
+ "directory": "react"
12
+ },
13
+ "scripts": {
14
+ "check-types": "tsc --noEmit",
15
+ "lint": "eslint \"**/*.ts\"",
16
+ "build": "rm -rf dist && vite build && cp ./dist/chainrails-common.es.js ./dist/chainrails-common.es.mjs && tsc --emitDeclarationOnly --declarationDir dist",
17
+ "clean": "rm -rf dist",
18
+ "prepare": "pnpm run clean && pnpm run build"
19
+ },
20
+ "source": "./index.ts",
21
+ "types": "./dist/src/index.d.ts",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/src/index.d.ts",
28
+ "import": "./dist/chainrails-common.es.mjs",
29
+ "require": "./dist/chainrails-common.umd.js"
30
+ },
31
+ "./src": {
32
+ "types": "./src/index.ts",
33
+ "import": "./src/index.ts",
34
+ "require": "./src/index.ts"
35
+ }
36
+ },
37
+ "dependencies": {
38
+ "vite": "^7.1.9"
39
+ },
40
+ "devDependencies": {
41
+ "eslint": "^8.57.0",
42
+ "typescript": "5.5.4"
43
+ }
44
+ }