@plyaz/config 0.1.0 → 1.0.1
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.
- package/README.md +10 -1
- package/dist/api.d.ts +22 -0
- package/dist/app.d.ts +12 -0
- package/dist/chains/contracts.d.ts +18 -0
- package/dist/chains/index.d.ts +2 -0
- package/dist/chains/supportedChains.d.ts +174 -0
- package/dist/constants.d.ts +3 -0
- package/dist/domains.d.ts +4 -0
- package/dist/env.d.ts +4 -0
- package/dist/features.d.ts +28 -0
- package/dist/index.cjs +267 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +169 -3
- package/dist/index.js.map +1 -1
- package/dist/providers/alchemy.d.ts +11 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/oauth.d.ts +20 -0
- package/dist/security.d.ts +3 -0
- package/package.json +4 -2
- package/dist/index.d.cts +0 -3
package/README.md
CHANGED
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Shared configuration constants and environment flags used throughout the Plyaz ecosystem. This package centralizes chain settings, feature toggles and other runtime values so that all apps share a single source of truth.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 📦 Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
pnpm add @plyaz/config
|
|
9
9
|
```
|
|
10
|
+
## 🚀 What's Included
|
|
11
|
+
|
|
12
|
+
### Core Configurations
|
|
13
|
+
- **Environment detection** - Server/client, dev/prod/test flags
|
|
14
|
+
- **Blockchain support** - Multi-chain configurations with testnets
|
|
15
|
+
- **Provider integrations** - Alchemy, OAuth providers, Web3 auth
|
|
16
|
+
- **API configurations** - Endpoints, caching, webhooks, rate limiting
|
|
17
|
+
- **Security policies** - Blocked regions, production safety flags
|
|
18
|
+
```
|
|
10
19
|
|
|
11
20
|
## Development
|
|
12
21
|
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const API_CONFIG: {};
|
|
2
|
+
export declare const CACHE_CONFIG: {
|
|
3
|
+
readonly ttl: {
|
|
4
|
+
readonly short: 300;
|
|
5
|
+
readonly medium: 1800;
|
|
6
|
+
readonly long: 3600;
|
|
7
|
+
readonly extended: 86400;
|
|
8
|
+
};
|
|
9
|
+
readonly keys: {
|
|
10
|
+
readonly user: "user:";
|
|
11
|
+
readonly nft: "nft:";
|
|
12
|
+
readonly blockchain: "blockchain:";
|
|
13
|
+
readonly auth: "auth:";
|
|
14
|
+
};
|
|
15
|
+
readonly redis: {
|
|
16
|
+
readonly url: string;
|
|
17
|
+
readonly keyPrefix: "plyaz:";
|
|
18
|
+
readonly maxRetriesPerRequest: 3;
|
|
19
|
+
readonly lazyConnect: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const WEBHOOK_CONFIG: {};
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const LANDING_PAGE_APP: {
|
|
2
|
+
readonly NAME: "Plyaz";
|
|
3
|
+
readonly VERSION: "1.0.0";
|
|
4
|
+
readonly DEFAULT_LOCALE: "en";
|
|
5
|
+
readonly SUPPORTED_LOCALES: readonly ["en", "es", "pt"];
|
|
6
|
+
};
|
|
7
|
+
export declare const WEB_APP: {
|
|
8
|
+
readonly NAME: "Plyaz The App";
|
|
9
|
+
readonly VERSION: "1.0.0";
|
|
10
|
+
readonly DEFAULT_LOCALE: "en";
|
|
11
|
+
readonly SUPPORTED_LOCALES: readonly ["en", "es", "pt"];
|
|
12
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const CONTRACTS: {
|
|
2
|
+
readonly nftManager: {
|
|
3
|
+
readonly read: {
|
|
4
|
+
readonly arbitrum: "";
|
|
5
|
+
};
|
|
6
|
+
readonly write: {
|
|
7
|
+
readonly arbitrum: "";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
readonly tokenManager: {
|
|
11
|
+
readonly read: {
|
|
12
|
+
readonly arbitrum: "";
|
|
13
|
+
};
|
|
14
|
+
readonly write: {
|
|
15
|
+
readonly arbitrum: "";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
export declare const PROD_SUPPORTED_CHAINS: {
|
|
2
|
+
readonly ethereum: {
|
|
3
|
+
blockExplorers: {
|
|
4
|
+
readonly default: {
|
|
5
|
+
readonly name: "Etherscan";
|
|
6
|
+
readonly url: "https://etherscan.io";
|
|
7
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
blockTime?: number | undefined | undefined;
|
|
11
|
+
contracts: {
|
|
12
|
+
readonly ensRegistry: {
|
|
13
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
14
|
+
};
|
|
15
|
+
readonly ensUniversalResolver: {
|
|
16
|
+
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
|
|
17
|
+
readonly blockCreated: 19258213;
|
|
18
|
+
};
|
|
19
|
+
readonly multicall3: {
|
|
20
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
21
|
+
readonly blockCreated: 14353601;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
ensTlds?: readonly string[] | undefined;
|
|
25
|
+
id: 1;
|
|
26
|
+
name: "Ethereum";
|
|
27
|
+
nativeCurrency: {
|
|
28
|
+
readonly name: "Ether";
|
|
29
|
+
readonly symbol: "ETH";
|
|
30
|
+
readonly decimals: 18;
|
|
31
|
+
};
|
|
32
|
+
rpcUrls: {
|
|
33
|
+
readonly default: {
|
|
34
|
+
readonly http: readonly ["https://eth.merkle.io"];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
sourceId?: number | undefined | undefined;
|
|
38
|
+
testnet?: boolean | undefined | undefined;
|
|
39
|
+
custom?: Record<string, unknown> | undefined;
|
|
40
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
41
|
+
formatters?: undefined;
|
|
42
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const STAGING_SUPPORTED_CHAINS: {
|
|
46
|
+
readonly ethereum: {
|
|
47
|
+
blockExplorers: {
|
|
48
|
+
readonly default: {
|
|
49
|
+
readonly name: "Etherscan";
|
|
50
|
+
readonly url: "https://etherscan.io";
|
|
51
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
blockTime?: number | undefined | undefined;
|
|
55
|
+
contracts: {
|
|
56
|
+
readonly ensRegistry: {
|
|
57
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
58
|
+
};
|
|
59
|
+
readonly ensUniversalResolver: {
|
|
60
|
+
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
|
|
61
|
+
readonly blockCreated: 19258213;
|
|
62
|
+
};
|
|
63
|
+
readonly multicall3: {
|
|
64
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
65
|
+
readonly blockCreated: 14353601;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
ensTlds?: readonly string[] | undefined;
|
|
69
|
+
id: 1;
|
|
70
|
+
name: "Ethereum";
|
|
71
|
+
nativeCurrency: {
|
|
72
|
+
readonly name: "Ether";
|
|
73
|
+
readonly symbol: "ETH";
|
|
74
|
+
readonly decimals: 18;
|
|
75
|
+
};
|
|
76
|
+
rpcUrls: {
|
|
77
|
+
readonly default: {
|
|
78
|
+
readonly http: readonly ["https://eth.merkle.io"];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
sourceId?: number | undefined | undefined;
|
|
82
|
+
testnet?: boolean | undefined | undefined;
|
|
83
|
+
custom?: Record<string, unknown> | undefined;
|
|
84
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
85
|
+
formatters?: undefined;
|
|
86
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
87
|
+
};
|
|
88
|
+
readonly sepolia: {
|
|
89
|
+
blockExplorers: {
|
|
90
|
+
readonly default: {
|
|
91
|
+
readonly name: "Etherscan";
|
|
92
|
+
readonly url: "https://sepolia.etherscan.io";
|
|
93
|
+
readonly apiUrl: "https://api-sepolia.etherscan.io/api";
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
blockTime?: number | undefined | undefined;
|
|
97
|
+
contracts: {
|
|
98
|
+
readonly multicall3: {
|
|
99
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
100
|
+
readonly blockCreated: 751532;
|
|
101
|
+
};
|
|
102
|
+
readonly ensRegistry: {
|
|
103
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
104
|
+
};
|
|
105
|
+
readonly ensUniversalResolver: {
|
|
106
|
+
readonly address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC";
|
|
107
|
+
readonly blockCreated: 5317080;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
ensTlds?: readonly string[] | undefined;
|
|
111
|
+
id: 11155111;
|
|
112
|
+
name: "Sepolia";
|
|
113
|
+
nativeCurrency: {
|
|
114
|
+
readonly name: "Sepolia Ether";
|
|
115
|
+
readonly symbol: "ETH";
|
|
116
|
+
readonly decimals: 18;
|
|
117
|
+
};
|
|
118
|
+
rpcUrls: {
|
|
119
|
+
readonly default: {
|
|
120
|
+
readonly http: readonly ["https://sepolia.drpc.org"];
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
sourceId?: number | undefined | undefined;
|
|
124
|
+
testnet: true;
|
|
125
|
+
custom?: Record<string, unknown> | undefined;
|
|
126
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
127
|
+
formatters?: undefined;
|
|
128
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export declare const DEV_SUPPORTED_CHAINS: {
|
|
132
|
+
readonly sepolia: {
|
|
133
|
+
blockExplorers: {
|
|
134
|
+
readonly default: {
|
|
135
|
+
readonly name: "Etherscan";
|
|
136
|
+
readonly url: "https://sepolia.etherscan.io";
|
|
137
|
+
readonly apiUrl: "https://api-sepolia.etherscan.io/api";
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
blockTime?: number | undefined | undefined;
|
|
141
|
+
contracts: {
|
|
142
|
+
readonly multicall3: {
|
|
143
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
144
|
+
readonly blockCreated: 751532;
|
|
145
|
+
};
|
|
146
|
+
readonly ensRegistry: {
|
|
147
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
148
|
+
};
|
|
149
|
+
readonly ensUniversalResolver: {
|
|
150
|
+
readonly address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC";
|
|
151
|
+
readonly blockCreated: 5317080;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
ensTlds?: readonly string[] | undefined;
|
|
155
|
+
id: 11155111;
|
|
156
|
+
name: "Sepolia";
|
|
157
|
+
nativeCurrency: {
|
|
158
|
+
readonly name: "Sepolia Ether";
|
|
159
|
+
readonly symbol: "ETH";
|
|
160
|
+
readonly decimals: 18;
|
|
161
|
+
};
|
|
162
|
+
rpcUrls: {
|
|
163
|
+
readonly default: {
|
|
164
|
+
readonly http: readonly ["https://sepolia.drpc.org"];
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
sourceId?: number | undefined | undefined;
|
|
168
|
+
testnet: true;
|
|
169
|
+
custom?: Record<string, unknown> | undefined;
|
|
170
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
171
|
+
formatters?: undefined;
|
|
172
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
173
|
+
};
|
|
174
|
+
};
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const FEATURES: {
|
|
2
|
+
readonly AUTH_GOOGLE: true;
|
|
3
|
+
readonly AUTH_DISCORD: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Default backend configuration for feature flags.
|
|
7
|
+
* Optimized for server-side usage with reasonable defaults.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_BACKEND_CONFIG: {
|
|
10
|
+
readonly provider: "database";
|
|
11
|
+
readonly isCacheEnabled: true;
|
|
12
|
+
readonly cacheTtl: 300;
|
|
13
|
+
readonly refreshInterval: 60;
|
|
14
|
+
readonly shouldFallbackToDefaults: true;
|
|
15
|
+
readonly isLoggingEnabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Default frontend configuration for feature flags.
|
|
19
|
+
* Optimized for client-side usage with reasonable defaults.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEFAULT_FRONTEND_CONFIG: {
|
|
22
|
+
readonly provider: "memory";
|
|
23
|
+
readonly isCacheEnabled: true;
|
|
24
|
+
readonly cacheTtl: 300;
|
|
25
|
+
readonly refreshInterval: 0;
|
|
26
|
+
readonly shouldFallbackToDefaults: true;
|
|
27
|
+
readonly isLoggingEnabled: false;
|
|
28
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,274 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// @plyaz package - Built with tsup
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
6
|
|
|
5
|
-
// src/
|
|
6
|
-
var
|
|
7
|
+
// src/env.ts
|
|
8
|
+
var isServer = typeof window === "undefined";
|
|
9
|
+
var isDev = globalThis.process.env.NODE_ENV === "development";
|
|
10
|
+
var isProd = globalThis.process.env.NODE_ENV === "production";
|
|
11
|
+
var isTest = globalThis.process.env.NODE_ENV === "test";
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
// src/providers/alchemy.ts
|
|
14
|
+
var ALCHEMY_CONFIG = {
|
|
15
|
+
apiKey: globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY,
|
|
16
|
+
rpcUrls: {
|
|
17
|
+
ethereum: `https://eth-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
18
|
+
polygon: `https://polygon-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
19
|
+
arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
20
|
+
optimism: `https://opt-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
21
|
+
base: `https://base-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
22
|
+
solana: `https://solana-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/providers/oauth.ts
|
|
27
|
+
var OAUTH_PROVIDERS = {
|
|
28
|
+
google: {
|
|
29
|
+
clientId: globalThis.process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
|
|
30
|
+
clientSecret: globalThis.process.env.GOOGLE_CLIENT_SECRET,
|
|
31
|
+
redirectUri: globalThis.process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI,
|
|
32
|
+
scopes: ["openid", "profile", "email"]
|
|
33
|
+
},
|
|
34
|
+
discord: {
|
|
35
|
+
clientId: globalThis.process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID,
|
|
36
|
+
clientSecret: globalThis.process.env.DISCORD_CLIENT_SECRET,
|
|
37
|
+
redirectUri: globalThis.process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI,
|
|
38
|
+
scopes: ["identify", "email"]
|
|
39
|
+
},
|
|
40
|
+
facebook: {
|
|
41
|
+
clientId: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID,
|
|
42
|
+
clientSecret: globalThis.process.env.FACEBOOK_CLIENT_SECRET,
|
|
43
|
+
redirectUri: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI,
|
|
44
|
+
scopes: ["public_profile", "email"]
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// src/chains/contracts.ts
|
|
49
|
+
var CONTRACTS = {
|
|
50
|
+
nftManager: {
|
|
51
|
+
read: {
|
|
52
|
+
arbitrum: ""
|
|
53
|
+
},
|
|
54
|
+
write: {
|
|
55
|
+
arbitrum: ""
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
tokenManager: {
|
|
59
|
+
read: {
|
|
60
|
+
arbitrum: ""
|
|
61
|
+
},
|
|
62
|
+
write: {
|
|
63
|
+
arbitrum: ""
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// node_modules/.pnpm/viem@2.32.1_typescript@5.8.3/node_modules/viem/_esm/utils/chain/defineChain.js
|
|
69
|
+
function defineChain(chain) {
|
|
70
|
+
return {
|
|
71
|
+
formatters: void 0,
|
|
72
|
+
fees: void 0,
|
|
73
|
+
serializers: void 0,
|
|
74
|
+
...chain
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
__name(defineChain, "defineChain");
|
|
78
|
+
|
|
79
|
+
// node_modules/.pnpm/viem@2.32.1_typescript@5.8.3/node_modules/viem/_esm/chains/definitions/mainnet.js
|
|
80
|
+
var mainnet = /* @__PURE__ */ defineChain({
|
|
81
|
+
id: 1,
|
|
82
|
+
name: "Ethereum",
|
|
83
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
84
|
+
rpcUrls: {
|
|
85
|
+
default: {
|
|
86
|
+
http: ["https://eth.merkle.io"]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
blockExplorers: {
|
|
90
|
+
default: {
|
|
91
|
+
name: "Etherscan",
|
|
92
|
+
url: "https://etherscan.io",
|
|
93
|
+
apiUrl: "https://api.etherscan.io/api"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
contracts: {
|
|
97
|
+
ensRegistry: {
|
|
98
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
|
99
|
+
},
|
|
100
|
+
ensUniversalResolver: {
|
|
101
|
+
address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
|
|
102
|
+
blockCreated: 19258213
|
|
103
|
+
},
|
|
104
|
+
multicall3: {
|
|
105
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
106
|
+
blockCreated: 14353601
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// node_modules/.pnpm/viem@2.32.1_typescript@5.8.3/node_modules/viem/_esm/chains/definitions/sepolia.js
|
|
112
|
+
var sepolia = /* @__PURE__ */ defineChain({
|
|
113
|
+
id: 11155111,
|
|
114
|
+
name: "Sepolia",
|
|
115
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
116
|
+
rpcUrls: {
|
|
117
|
+
default: {
|
|
118
|
+
http: ["https://sepolia.drpc.org"]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
blockExplorers: {
|
|
122
|
+
default: {
|
|
123
|
+
name: "Etherscan",
|
|
124
|
+
url: "https://sepolia.etherscan.io",
|
|
125
|
+
apiUrl: "https://api-sepolia.etherscan.io/api"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
contracts: {
|
|
129
|
+
multicall3: {
|
|
130
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
131
|
+
blockCreated: 751532
|
|
132
|
+
},
|
|
133
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
134
|
+
ensUniversalResolver: {
|
|
135
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
136
|
+
blockCreated: 5317080
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
testnet: true
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// src/chains/supportedChains.ts
|
|
143
|
+
var PROD_SUPPORTED_CHAINS = {
|
|
144
|
+
// Mainnets
|
|
145
|
+
ethereum: mainnet
|
|
146
|
+
};
|
|
147
|
+
var STAGING_SUPPORTED_CHAINS = {
|
|
148
|
+
// Mainnets
|
|
149
|
+
ethereum: mainnet,
|
|
150
|
+
// Testnets
|
|
151
|
+
sepolia
|
|
152
|
+
};
|
|
153
|
+
var DEV_SUPPORTED_CHAINS = {
|
|
154
|
+
// Testnets
|
|
155
|
+
sepolia
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/features.ts
|
|
159
|
+
var FEATURES = {
|
|
160
|
+
// Authentication & Auth Providers
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
162
|
+
AUTH_GOOGLE: true,
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
164
|
+
AUTH_DISCORD: isDev
|
|
165
|
+
};
|
|
166
|
+
var DEFAULT_BACKEND_CONFIG = {
|
|
167
|
+
provider: "database",
|
|
168
|
+
isCacheEnabled: true,
|
|
169
|
+
cacheTtl: 300,
|
|
170
|
+
// 5 minutes
|
|
171
|
+
refreshInterval: 60,
|
|
172
|
+
// 1 minute auto-refresh
|
|
173
|
+
shouldFallbackToDefaults: true,
|
|
174
|
+
isLoggingEnabled: globalThis.process.env.NODE_ENV === "development"
|
|
175
|
+
};
|
|
176
|
+
var DEFAULT_FRONTEND_CONFIG = {
|
|
177
|
+
provider: "memory",
|
|
178
|
+
isCacheEnabled: true,
|
|
179
|
+
cacheTtl: 300,
|
|
180
|
+
// 5 minutes
|
|
181
|
+
refreshInterval: 0,
|
|
182
|
+
// No auto-refresh for frontend
|
|
183
|
+
shouldFallbackToDefaults: true,
|
|
184
|
+
isLoggingEnabled: false
|
|
185
|
+
// Disabled in production
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/domains.ts
|
|
189
|
+
var DOMAINS = {
|
|
190
|
+
app: "https://plyaz.co.uk",
|
|
191
|
+
api: globalThis.process.env.NEXT_PUBLIC_API_URL
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// src/constants.ts
|
|
195
|
+
var DEFAULT_LOCALE = "en";
|
|
196
|
+
var SUPPORTED_LOCALES = ["en", "es", "pt"];
|
|
197
|
+
var TIMEZONE = "Europe/London";
|
|
198
|
+
|
|
199
|
+
// src/app.ts
|
|
200
|
+
var LANDING_PAGE_APP = {
|
|
201
|
+
NAME: "Plyaz",
|
|
202
|
+
VERSION: "1.0.0",
|
|
203
|
+
DEFAULT_LOCALE,
|
|
204
|
+
SUPPORTED_LOCALES
|
|
205
|
+
};
|
|
206
|
+
var WEB_APP = {
|
|
207
|
+
NAME: "Plyaz The App",
|
|
208
|
+
VERSION: "1.0.0",
|
|
209
|
+
DEFAULT_LOCALE,
|
|
210
|
+
SUPPORTED_LOCALES
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// src/security.ts
|
|
214
|
+
var SECURITY = {
|
|
215
|
+
BLOCKED_REGIONS: ["KP", "SY", "IR", "CU", "SD", "SO", "UA-CR", "UA-DP", "UA-LU"]
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// src/api.ts
|
|
219
|
+
var API_CONFIG = {};
|
|
220
|
+
var CACHE_CONFIG = {
|
|
221
|
+
// Cache TTL in seconds
|
|
222
|
+
ttl: {
|
|
223
|
+
short: 300,
|
|
224
|
+
// 5 minutes
|
|
225
|
+
medium: 1800,
|
|
226
|
+
// 30 minutes
|
|
227
|
+
long: 3600,
|
|
228
|
+
// 1 hour
|
|
229
|
+
extended: 86400
|
|
230
|
+
// 24 hours
|
|
231
|
+
},
|
|
232
|
+
// Cache keys
|
|
233
|
+
keys: {
|
|
234
|
+
user: "user:",
|
|
235
|
+
nft: "nft:",
|
|
236
|
+
blockchain: "blockchain:",
|
|
237
|
+
auth: "auth:"
|
|
238
|
+
},
|
|
239
|
+
// Redis configuration
|
|
240
|
+
redis: {
|
|
241
|
+
url: globalThis.process.env.REDIS_URL,
|
|
242
|
+
keyPrefix: "plyaz:",
|
|
243
|
+
maxRetriesPerRequest: 3,
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
245
|
+
lazyConnect: true
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var WEBHOOK_CONFIG = {};
|
|
249
|
+
|
|
250
|
+
exports.ALCHEMY_CONFIG = ALCHEMY_CONFIG;
|
|
251
|
+
exports.API_CONFIG = API_CONFIG;
|
|
252
|
+
exports.CACHE_CONFIG = CACHE_CONFIG;
|
|
253
|
+
exports.CONTRACTS = CONTRACTS;
|
|
254
|
+
exports.DEFAULT_BACKEND_CONFIG = DEFAULT_BACKEND_CONFIG;
|
|
255
|
+
exports.DEFAULT_FRONTEND_CONFIG = DEFAULT_FRONTEND_CONFIG;
|
|
256
|
+
exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
|
|
257
|
+
exports.DEV_SUPPORTED_CHAINS = DEV_SUPPORTED_CHAINS;
|
|
258
|
+
exports.DOMAINS = DOMAINS;
|
|
259
|
+
exports.FEATURES = FEATURES;
|
|
260
|
+
exports.LANDING_PAGE_APP = LANDING_PAGE_APP;
|
|
261
|
+
exports.OAUTH_PROVIDERS = OAUTH_PROVIDERS;
|
|
262
|
+
exports.PROD_SUPPORTED_CHAINS = PROD_SUPPORTED_CHAINS;
|
|
263
|
+
exports.SECURITY = SECURITY;
|
|
264
|
+
exports.STAGING_SUPPORTED_CHAINS = STAGING_SUPPORTED_CHAINS;
|
|
265
|
+
exports.SUPPORTED_LOCALES = SUPPORTED_LOCALES;
|
|
266
|
+
exports.TIMEZONE = TIMEZONE;
|
|
267
|
+
exports.WEBHOOK_CONFIG = WEBHOOK_CONFIG;
|
|
268
|
+
exports.WEB_APP = WEB_APP;
|
|
269
|
+
exports.isDev = isDev;
|
|
270
|
+
exports.isProd = isProd;
|
|
271
|
+
exports.isServer = isServer;
|
|
272
|
+
exports.isTest = isTest;
|
|
9
273
|
//# sourceMappingURL=index.cjs.map
|
|
10
274
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAO,IAAM,YAAA,GAAe","file":"index.cjs","sourcesContent":["export const PACKAGE_TEST = 1;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/env.ts","../src/providers/alchemy.ts","../src/providers/oauth.ts","../src/chains/contracts.ts","../node_modules/.pnpm/viem@2.32.1_typescript@5.8.3/node_modules/viem/utils/chain/defineChain.ts","../node_modules/.pnpm/viem@2.32.1_typescript@5.8.3/node_modules/viem/chains/definitions/mainnet.ts","../node_modules/.pnpm/viem@2.32.1_typescript@5.8.3/node_modules/viem/chains/definitions/sepolia.ts","../src/chains/supportedChains.ts","../src/features.ts","../src/domains.ts","../src/constants.ts","../src/app.ts","../src/security.ts","../src/api.ts"],"names":[],"mappings":";;;;;;;AAAO,IAAM,QAAA,GAAW,OAAO,MAAA,KAAW;AACnC,IAAM,KAAA,GAAQ,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AAClD,IAAM,MAAA,GAAS,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AACnD,IAAM,MAAA,GAAS,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;;;ACHnD,IAAM,cAAA,GAAiB;AAAA,EAC5B,MAAA,EAAQ,UAAA,CAAW,OAAA,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,EAAM,OAAA;AAAA,IACN,GAAA,EAAK,MAAA;AAAA,IACL,UAAA,EAAY,aAAA;AAAA,IACZ,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAGA,KAAA,EAAO;AAAA,IACL,GAAA,EAAK,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,SAAA;AAAA,IAC5B,SAAA,EAAW,QAAA;AAAA,IACX,oBAAA,EAAsB,CAAA;AAAA;AAAA,IAEtB,WAAA,EAAa;AAAA;AAEjB;AAEO,IAAM,iBAAiB","file":"index.cjs","sourcesContent":["export const isServer = typeof window === 'undefined';\nexport const isDev = globalThis.process.env.NODE_ENV === 'development';\nexport const isProd = globalThis.process.env.NODE_ENV === 'production';\nexport const isTest = globalThis.process.env.NODE_ENV === 'test';\n","export const ALCHEMY_CONFIG = {\n apiKey: globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY!,\n rpcUrls: {\n ethereum: `https://eth-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n polygon: `https://polygon-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n optimism: `https://opt-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n base: `https://base-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n solana: `https://solana-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n },\n};\n","export const OAUTH_PROVIDERS = {\n google: {\n clientId: globalThis.process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID!,\n clientSecret: globalThis.process.env.GOOGLE_CLIENT_SECRET!,\n redirectUri: globalThis.process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI!,\n scopes: ['openid', 'profile', 'email'],\n },\n discord: {\n clientId: globalThis.process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID!,\n clientSecret: globalThis.process.env.DISCORD_CLIENT_SECRET!,\n redirectUri: globalThis.process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI!,\n scopes: ['identify', 'email'],\n },\n facebook: {\n clientId: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID!,\n clientSecret: globalThis.process.env.FACEBOOK_CLIENT_SECRET!,\n redirectUri: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI!,\n scopes: ['public_profile', 'email'],\n },\n} as const;\n","export const CONTRACTS = {\n nftManager: {\n read: {\n arbitrum: '',\n },\n write: {\n arbitrum: '',\n },\n },\n tokenManager: {\n read: {\n arbitrum: '',\n },\n write: {\n arbitrum: '',\n },\n },\n} as const;\n","import type { Chain, ChainFormatters } from '../../types/chain.js'\nimport type { Assign, Prettify } from '../../types/utils.js'\n\nexport function defineChain<\n formatters extends ChainFormatters,\n const chain extends Chain<formatters>,\n>(chain: chain): Prettify<Assign<Chain<undefined>, chain>> {\n return {\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n } as Assign<Chain<undefined>, chain>\n}\n","import { defineChain } from '../../utils/chain/defineChain.js'\n\nexport const mainnet = /*#__PURE__*/ defineChain({\n id: 1,\n name: 'Ethereum',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://eth.merkle.io'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Etherscan',\n url: 'https://etherscan.io',\n apiUrl: 'https://api.etherscan.io/api',\n },\n },\n contracts: {\n ensRegistry: {\n address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',\n },\n ensUniversalResolver: {\n address: '0xce01f8eee7E479C928F8919abD53E553a36CeF67',\n blockCreated: 19_258_213,\n },\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 14_353_601,\n },\n },\n})\n","import { defineChain } from '../../utils/chain/defineChain.js'\n\nexport const sepolia = /*#__PURE__*/ defineChain({\n id: 11_155_111,\n name: 'Sepolia',\n nativeCurrency: { name: 'Sepolia Ether', symbol: 'ETH', decimals: 18 },\n rpcUrls: {\n default: {\n http: ['https://sepolia.drpc.org'],\n },\n },\n blockExplorers: {\n default: {\n name: 'Etherscan',\n url: 'https://sepolia.etherscan.io',\n apiUrl: 'https://api-sepolia.etherscan.io/api',\n },\n },\n contracts: {\n multicall3: {\n address: '0xca11bde05977b3631167028862be2a173976ca11',\n blockCreated: 751532,\n },\n ensRegistry: { address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e' },\n ensUniversalResolver: {\n address: '0xc8Af999e38273D658BE1b921b88A9Ddf005769cC',\n blockCreated: 5_317_080,\n },\n },\n testnet: true,\n})\n","import { mainnet, sepolia } from 'viem/chains';\n\nexport const PROD_SUPPORTED_CHAINS = {\n // Mainnets\n ethereum: mainnet,\n} as const;\n\nexport const STAGING_SUPPORTED_CHAINS = {\n // Mainnets\n ethereum: mainnet,\n // Testnets\n sepolia,\n} as const;\n\nexport const DEV_SUPPORTED_CHAINS = {\n // Testnets\n sepolia,\n} as const;\n","import { isDev } from './env';\n\nexport const FEATURES = {\n // Authentication & Auth Providers\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AUTH_GOOGLE: true,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AUTH_DISCORD: isDev,\n} as const;\n\n/**\n * Default backend configuration for feature flags.\n * Optimized for server-side usage with reasonable defaults.\n */\nexport const DEFAULT_BACKEND_CONFIG = {\n provider: 'database',\n isCacheEnabled: true,\n cacheTtl: 300, // 5 minutes\n refreshInterval: 60, // 1 minute auto-refresh\n shouldFallbackToDefaults: true,\n isLoggingEnabled: globalThis.process.env.NODE_ENV === 'development',\n} as const;\n\n/**\n * Default frontend configuration for feature flags.\n * Optimized for client-side usage with reasonable defaults.\n */\nexport const DEFAULT_FRONTEND_CONFIG = {\n provider: 'memory',\n isCacheEnabled: true,\n cacheTtl: 300, // 5 minutes\n refreshInterval: 0, // No auto-refresh for frontend\n shouldFallbackToDefaults: true,\n isLoggingEnabled: false, // Disabled in production\n} as const;\n","export const DOMAINS = {\n app: 'https://plyaz.co.uk',\n api: globalThis.process.env.NEXT_PUBLIC_API_URL!,\n} as const;\n","export const DEFAULT_LOCALE = 'en';\nexport const SUPPORTED_LOCALES = ['en', 'es', 'pt'] as const;\nexport const TIMEZONE = 'Europe/London';","import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from './constants';\n\nexport const LANDING_PAGE_APP = {\n NAME: 'Plyaz',\n VERSION: '1.0.0',\n DEFAULT_LOCALE,\n SUPPORTED_LOCALES,\n} as const;\n\nexport const WEB_APP = {\n NAME: 'Plyaz The App',\n VERSION: '1.0.0',\n DEFAULT_LOCALE,\n SUPPORTED_LOCALES,\n} as const;\n","export const SECURITY = {\n BLOCKED_REGIONS: ['KP', 'SY', 'IR', 'CU', 'SD', 'SO', 'UA-CR', 'UA-DP', 'UA-LU'],\n} as const;\n","export const API_CONFIG = {} as const;\n\nexport const CACHE_CONFIG = {\n // Cache TTL in seconds\n ttl: {\n short: 300, // 5 minutes\n medium: 1800, // 30 minutes\n long: 3600, // 1 hour\n extended: 86400, // 24 hours\n },\n\n // Cache keys\n keys: {\n user: 'user:',\n nft: 'nft:',\n blockchain: 'blockchain:',\n auth: 'auth:',\n },\n\n // Redis configuration\n redis: {\n url: globalThis.process.env.REDIS_URL!,\n keyPrefix: 'plyaz:',\n maxRetriesPerRequest: 3,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n lazyConnect: true,\n },\n} as const;\n\nexport const WEBHOOK_CONFIG = {} as const;\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './env';
|
|
2
|
+
export * from './providers';
|
|
3
|
+
export * from './chains';
|
|
4
|
+
export * from './features';
|
|
5
|
+
export * from './domains';
|
|
6
|
+
export * from './app';
|
|
7
|
+
export * from './security';
|
|
8
|
+
export * from './constants';
|
|
9
|
+
export * from './api';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,174 @@
|
|
|
1
|
+
import { sepolia, mainnet } from 'viem/chains';
|
|
2
|
+
|
|
1
3
|
// @plyaz package - Built with tsup
|
|
2
4
|
|
|
3
|
-
// src/
|
|
4
|
-
var
|
|
5
|
+
// src/env.ts
|
|
6
|
+
var isServer = typeof window === "undefined";
|
|
7
|
+
var isDev = globalThis.process.env.NODE_ENV === "development";
|
|
8
|
+
var isProd = globalThis.process.env.NODE_ENV === "production";
|
|
9
|
+
var isTest = globalThis.process.env.NODE_ENV === "test";
|
|
10
|
+
|
|
11
|
+
// src/providers/alchemy.ts
|
|
12
|
+
var ALCHEMY_CONFIG = {
|
|
13
|
+
apiKey: globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY,
|
|
14
|
+
rpcUrls: {
|
|
15
|
+
ethereum: `https://eth-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
16
|
+
polygon: `https://polygon-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
17
|
+
arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
18
|
+
optimism: `https://opt-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
19
|
+
base: `https://base-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
20
|
+
solana: `https://solana-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// src/providers/oauth.ts
|
|
25
|
+
var OAUTH_PROVIDERS = {
|
|
26
|
+
google: {
|
|
27
|
+
clientId: globalThis.process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
|
|
28
|
+
clientSecret: globalThis.process.env.GOOGLE_CLIENT_SECRET,
|
|
29
|
+
redirectUri: globalThis.process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI,
|
|
30
|
+
scopes: ["openid", "profile", "email"]
|
|
31
|
+
},
|
|
32
|
+
discord: {
|
|
33
|
+
clientId: globalThis.process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID,
|
|
34
|
+
clientSecret: globalThis.process.env.DISCORD_CLIENT_SECRET,
|
|
35
|
+
redirectUri: globalThis.process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI,
|
|
36
|
+
scopes: ["identify", "email"]
|
|
37
|
+
},
|
|
38
|
+
facebook: {
|
|
39
|
+
clientId: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID,
|
|
40
|
+
clientSecret: globalThis.process.env.FACEBOOK_CLIENT_SECRET,
|
|
41
|
+
redirectUri: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI,
|
|
42
|
+
scopes: ["public_profile", "email"]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/chains/contracts.ts
|
|
47
|
+
var CONTRACTS = {
|
|
48
|
+
nftManager: {
|
|
49
|
+
read: {
|
|
50
|
+
arbitrum: ""
|
|
51
|
+
},
|
|
52
|
+
write: {
|
|
53
|
+
arbitrum: ""
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
tokenManager: {
|
|
57
|
+
read: {
|
|
58
|
+
arbitrum: ""
|
|
59
|
+
},
|
|
60
|
+
write: {
|
|
61
|
+
arbitrum: ""
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var PROD_SUPPORTED_CHAINS = {
|
|
66
|
+
// Mainnets
|
|
67
|
+
ethereum: mainnet
|
|
68
|
+
};
|
|
69
|
+
var STAGING_SUPPORTED_CHAINS = {
|
|
70
|
+
// Mainnets
|
|
71
|
+
ethereum: mainnet,
|
|
72
|
+
// Testnets
|
|
73
|
+
sepolia
|
|
74
|
+
};
|
|
75
|
+
var DEV_SUPPORTED_CHAINS = {
|
|
76
|
+
// Testnets
|
|
77
|
+
sepolia
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/features.ts
|
|
81
|
+
var FEATURES = {
|
|
82
|
+
// Authentication & Auth Providers
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
84
|
+
AUTH_GOOGLE: true,
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
86
|
+
AUTH_DISCORD: isDev
|
|
87
|
+
};
|
|
88
|
+
var DEFAULT_BACKEND_CONFIG = {
|
|
89
|
+
provider: "database",
|
|
90
|
+
isCacheEnabled: true,
|
|
91
|
+
cacheTtl: 300,
|
|
92
|
+
// 5 minutes
|
|
93
|
+
refreshInterval: 60,
|
|
94
|
+
// 1 minute auto-refresh
|
|
95
|
+
shouldFallbackToDefaults: true,
|
|
96
|
+
isLoggingEnabled: globalThis.process.env.NODE_ENV === "development"
|
|
97
|
+
};
|
|
98
|
+
var DEFAULT_FRONTEND_CONFIG = {
|
|
99
|
+
provider: "memory",
|
|
100
|
+
isCacheEnabled: true,
|
|
101
|
+
cacheTtl: 300,
|
|
102
|
+
// 5 minutes
|
|
103
|
+
refreshInterval: 0,
|
|
104
|
+
// No auto-refresh for frontend
|
|
105
|
+
shouldFallbackToDefaults: true,
|
|
106
|
+
isLoggingEnabled: false
|
|
107
|
+
// Disabled in production
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// src/domains.ts
|
|
111
|
+
var DOMAINS = {
|
|
112
|
+
app: "https://plyaz.co.uk",
|
|
113
|
+
api: globalThis.process.env.NEXT_PUBLIC_API_URL
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// src/constants.ts
|
|
117
|
+
var DEFAULT_LOCALE = "en";
|
|
118
|
+
var SUPPORTED_LOCALES = ["en", "es", "pt"];
|
|
119
|
+
var TIMEZONE = "Europe/London";
|
|
120
|
+
|
|
121
|
+
// src/app.ts
|
|
122
|
+
var LANDING_PAGE_APP = {
|
|
123
|
+
NAME: "Plyaz",
|
|
124
|
+
VERSION: "1.0.0",
|
|
125
|
+
DEFAULT_LOCALE,
|
|
126
|
+
SUPPORTED_LOCALES
|
|
127
|
+
};
|
|
128
|
+
var WEB_APP = {
|
|
129
|
+
NAME: "Plyaz The App",
|
|
130
|
+
VERSION: "1.0.0",
|
|
131
|
+
DEFAULT_LOCALE,
|
|
132
|
+
SUPPORTED_LOCALES
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// src/security.ts
|
|
136
|
+
var SECURITY = {
|
|
137
|
+
BLOCKED_REGIONS: ["KP", "SY", "IR", "CU", "SD", "SO", "UA-CR", "UA-DP", "UA-LU"]
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// src/api.ts
|
|
141
|
+
var API_CONFIG = {};
|
|
142
|
+
var CACHE_CONFIG = {
|
|
143
|
+
// Cache TTL in seconds
|
|
144
|
+
ttl: {
|
|
145
|
+
short: 300,
|
|
146
|
+
// 5 minutes
|
|
147
|
+
medium: 1800,
|
|
148
|
+
// 30 minutes
|
|
149
|
+
long: 3600,
|
|
150
|
+
// 1 hour
|
|
151
|
+
extended: 86400
|
|
152
|
+
// 24 hours
|
|
153
|
+
},
|
|
154
|
+
// Cache keys
|
|
155
|
+
keys: {
|
|
156
|
+
user: "user:",
|
|
157
|
+
nft: "nft:",
|
|
158
|
+
blockchain: "blockchain:",
|
|
159
|
+
auth: "auth:"
|
|
160
|
+
},
|
|
161
|
+
// Redis configuration
|
|
162
|
+
redis: {
|
|
163
|
+
url: globalThis.process.env.REDIS_URL,
|
|
164
|
+
keyPrefix: "plyaz:",
|
|
165
|
+
maxRetriesPerRequest: 3,
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
167
|
+
lazyConnect: true
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
var WEBHOOK_CONFIG = {};
|
|
5
171
|
|
|
6
|
-
export {
|
|
172
|
+
export { ALCHEMY_CONFIG, API_CONFIG, CACHE_CONFIG, CONTRACTS, DEFAULT_BACKEND_CONFIG, DEFAULT_FRONTEND_CONFIG, DEFAULT_LOCALE, DEV_SUPPORTED_CHAINS, DOMAINS, FEATURES, LANDING_PAGE_APP, OAUTH_PROVIDERS, PROD_SUPPORTED_CHAINS, SECURITY, STAGING_SUPPORTED_CHAINS, SUPPORTED_LOCALES, TIMEZONE, WEBHOOK_CONFIG, WEB_APP, isDev, isProd, isServer, isTest };
|
|
7
173
|
//# sourceMappingURL=index.js.map
|
|
8
174
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/env.ts","../src/providers/alchemy.ts","../src/providers/oauth.ts","../src/chains/contracts.ts","../src/chains/supportedChains.ts","../src/features.ts","../src/domains.ts","../src/constants.ts","../src/app.ts","../src/security.ts","../src/api.ts"],"names":[],"mappings":";;;;;AAAO,IAAM,QAAA,GAAW,OAAO,MAAA,KAAW;AACnC,IAAM,KAAA,GAAQ,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AAClD,IAAM,MAAA,GAAS,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AACnD,IAAM,MAAA,GAAS,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;;;ACHnD,IAAM,cAAA,GAAiB;AAAA,EAC5B,MAAA,EAAQ,UAAA,CAAW,OAAA,CAAQ,GAAA,CAAI,uBAAA;AAAA,EAC/B,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,CAAA,qCAAA,EAAwC,UAAA,CAAW,OAAA,CAAQ,IAAI,uBAAuB,CAAA,CAAA;AAAA,IACh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AAA;AAAA;AAAA,IAEtB,WAAA,EAAa;AAAA;AAEjB;AAEO,IAAM,iBAAiB","file":"index.js","sourcesContent":["export const isServer = typeof window === 'undefined';\nexport const isDev = globalThis.process.env.NODE_ENV === 'development';\nexport const isProd = globalThis.process.env.NODE_ENV === 'production';\nexport const isTest = globalThis.process.env.NODE_ENV === 'test';\n","export const ALCHEMY_CONFIG = {\n apiKey: globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY!,\n rpcUrls: {\n ethereum: `https://eth-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n polygon: `https://polygon-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n optimism: `https://opt-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n base: `https://base-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n solana: `https://solana-mainnet.g.alchemy.com/v2/${globalThis.process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n },\n};\n","export const OAUTH_PROVIDERS = {\n google: {\n clientId: globalThis.process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID!,\n clientSecret: globalThis.process.env.GOOGLE_CLIENT_SECRET!,\n redirectUri: globalThis.process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI!,\n scopes: ['openid', 'profile', 'email'],\n },\n discord: {\n clientId: globalThis.process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID!,\n clientSecret: globalThis.process.env.DISCORD_CLIENT_SECRET!,\n redirectUri: globalThis.process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI!,\n scopes: ['identify', 'email'],\n },\n facebook: {\n clientId: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID!,\n clientSecret: globalThis.process.env.FACEBOOK_CLIENT_SECRET!,\n redirectUri: globalThis.process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI!,\n scopes: ['public_profile', 'email'],\n },\n} as const;\n","export const CONTRACTS = {\n nftManager: {\n read: {\n arbitrum: '',\n },\n write: {\n arbitrum: '',\n },\n },\n tokenManager: {\n read: {\n arbitrum: '',\n },\n write: {\n arbitrum: '',\n },\n },\n} as const;\n","import { mainnet, sepolia } from 'viem/chains';\n\nexport const PROD_SUPPORTED_CHAINS = {\n // Mainnets\n ethereum: mainnet,\n} as const;\n\nexport const STAGING_SUPPORTED_CHAINS = {\n // Mainnets\n ethereum: mainnet,\n // Testnets\n sepolia,\n} as const;\n\nexport const DEV_SUPPORTED_CHAINS = {\n // Testnets\n sepolia,\n} as const;\n","import { isDev } from './env';\n\nexport const FEATURES = {\n // Authentication & Auth Providers\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AUTH_GOOGLE: true,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n AUTH_DISCORD: isDev,\n} as const;\n\n/**\n * Default backend configuration for feature flags.\n * Optimized for server-side usage with reasonable defaults.\n */\nexport const DEFAULT_BACKEND_CONFIG = {\n provider: 'database',\n isCacheEnabled: true,\n cacheTtl: 300, // 5 minutes\n refreshInterval: 60, // 1 minute auto-refresh\n shouldFallbackToDefaults: true,\n isLoggingEnabled: globalThis.process.env.NODE_ENV === 'development',\n} as const;\n\n/**\n * Default frontend configuration for feature flags.\n * Optimized for client-side usage with reasonable defaults.\n */\nexport const DEFAULT_FRONTEND_CONFIG = {\n provider: 'memory',\n isCacheEnabled: true,\n cacheTtl: 300, // 5 minutes\n refreshInterval: 0, // No auto-refresh for frontend\n shouldFallbackToDefaults: true,\n isLoggingEnabled: false, // Disabled in production\n} as const;\n","export const DOMAINS = {\n app: 'https://plyaz.co.uk',\n api: globalThis.process.env.NEXT_PUBLIC_API_URL!,\n} as const;\n","export const DEFAULT_LOCALE = 'en';\nexport const SUPPORTED_LOCALES = ['en', 'es', 'pt'] as const;\nexport const TIMEZONE = 'Europe/London';","import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from './constants';\n\nexport const LANDING_PAGE_APP = {\n NAME: 'Plyaz',\n VERSION: '1.0.0',\n DEFAULT_LOCALE,\n SUPPORTED_LOCALES,\n} as const;\n\nexport const WEB_APP = {\n NAME: 'Plyaz The App',\n VERSION: '1.0.0',\n DEFAULT_LOCALE,\n SUPPORTED_LOCALES,\n} as const;\n","export const SECURITY = {\n BLOCKED_REGIONS: ['KP', 'SY', 'IR', 'CU', 'SD', 'SO', 'UA-CR', 'UA-DP', 'UA-LU'],\n} as const;\n","export const API_CONFIG = {} as const;\n\nexport const CACHE_CONFIG = {\n // Cache TTL in seconds\n ttl: {\n short: 300, // 5 minutes\n medium: 1800, // 30 minutes\n long: 3600, // 1 hour\n extended: 86400, // 24 hours\n },\n\n // Cache keys\n keys: {\n user: 'user:',\n nft: 'nft:',\n blockchain: 'blockchain:',\n auth: 'auth:',\n },\n\n // Redis configuration\n redis: {\n url: globalThis.process.env.REDIS_URL!,\n keyPrefix: 'plyaz:',\n maxRetriesPerRequest: 3,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n lazyConnect: true,\n },\n} as const;\n\nexport const WEBHOOK_CONFIG = {} as const;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const OAUTH_PROVIDERS: {
|
|
2
|
+
readonly google: {
|
|
3
|
+
readonly clientId: string;
|
|
4
|
+
readonly clientSecret: string;
|
|
5
|
+
readonly redirectUri: string;
|
|
6
|
+
readonly scopes: readonly ["openid", "profile", "email"];
|
|
7
|
+
};
|
|
8
|
+
readonly discord: {
|
|
9
|
+
readonly clientId: string;
|
|
10
|
+
readonly clientSecret: string;
|
|
11
|
+
readonly redirectUri: string;
|
|
12
|
+
readonly scopes: readonly ["identify", "email"];
|
|
13
|
+
};
|
|
14
|
+
readonly facebook: {
|
|
15
|
+
readonly clientId: string;
|
|
16
|
+
readonly clientSecret: string;
|
|
17
|
+
readonly redirectUri: string;
|
|
18
|
+
readonly scopes: readonly ["public_profile", "email"];
|
|
19
|
+
};
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/config",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"author": "Redeemer Pace",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Provides shared configs and constants for @playz ecosystem.",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@nestjs/common": "^11.1.3",
|
|
39
39
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
40
40
|
"@plyaz/devtools": "^1.5.5",
|
|
41
|
+
"@plyaz/types": "^1.1.2",
|
|
41
42
|
"@types/node": "^20.0.0",
|
|
42
43
|
"@types/react": "^19.1.8",
|
|
43
44
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
"tsup": "8.5.0",
|
|
82
83
|
"typescript": "^5",
|
|
83
84
|
"typescript-eslint": "^8.34.0",
|
|
85
|
+
"viem": "^2.31.7",
|
|
84
86
|
"vitest": "3.2.4"
|
|
85
87
|
},
|
|
86
88
|
"peerDependenciesMeta": {
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
"scripts": {
|
|
98
100
|
"build": "pnpm clean && pnpm build:js && pnpm build:types",
|
|
99
101
|
"build:js": "tsup",
|
|
100
|
-
"build:types": "tsc src/index.ts --emitDeclarationOnly --outDir dist --declaration",
|
|
102
|
+
"build:types": "tsc src/index.ts --emitDeclarationOnly --outDir dist --declaration --skipLibCheck",
|
|
101
103
|
"build:watch": "tsup --watch",
|
|
102
104
|
"dev": "tsup --watch",
|
|
103
105
|
"lint": "eslint ./src",
|
package/dist/index.d.cts
DELETED