@plyaz/config 0.1.0 → 1.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.
- 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/supportedChains.d.ts +174 -0
- package/dist/constants.d.ts +2 -0
- package/dist/domains.d.ts +4 -0
- package/dist/env.d.ts +4 -0
- package/dist/features.d.ts +4 -0
- package/dist/index.cjs +239 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +144 -3
- package/dist/index.js.map +1 -1
- package/dist/providers/alchemy.d.ts +11 -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
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,246 @@
|
|
|
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 = process.env.NODE_ENV === "development";
|
|
10
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
11
|
+
var isTest = process.env.NODE_ENV === "test";
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
// src/providers/alchemy.ts
|
|
14
|
+
var ALCHEMY_CONFIG = {
|
|
15
|
+
apiKey: process.env.NEXT_PUBLIC_ALCHEMY_KEY,
|
|
16
|
+
rpcUrls: {
|
|
17
|
+
ethereum: `https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
18
|
+
polygon: `https://polygon-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
19
|
+
arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
20
|
+
optimism: `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
21
|
+
base: `https://base-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
22
|
+
solana: `https://solana-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/providers/oauth.ts
|
|
27
|
+
var OAUTH_PROVIDERS = {
|
|
28
|
+
google: {
|
|
29
|
+
clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
|
|
30
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
|
31
|
+
redirectUri: process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI,
|
|
32
|
+
scopes: ["openid", "profile", "email"]
|
|
33
|
+
},
|
|
34
|
+
discord: {
|
|
35
|
+
clientId: process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID,
|
|
36
|
+
clientSecret: process.env.DISCORD_CLIENT_SECRET,
|
|
37
|
+
redirectUri: process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI,
|
|
38
|
+
scopes: ["identify", "email"]
|
|
39
|
+
},
|
|
40
|
+
facebook: {
|
|
41
|
+
clientId: process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID,
|
|
42
|
+
clientSecret: process.env.FACEBOOK_CLIENT_SECRET,
|
|
43
|
+
redirectUri: process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI,
|
|
44
|
+
scopes: ["public_profile", "email"]
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// node_modules/.pnpm/viem@2.31.7_typescript@5.8.3/node_modules/viem/_esm/utils/chain/defineChain.js
|
|
49
|
+
function defineChain(chain) {
|
|
50
|
+
return {
|
|
51
|
+
formatters: void 0,
|
|
52
|
+
fees: void 0,
|
|
53
|
+
serializers: void 0,
|
|
54
|
+
...chain
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
__name(defineChain, "defineChain");
|
|
58
|
+
|
|
59
|
+
// node_modules/.pnpm/viem@2.31.7_typescript@5.8.3/node_modules/viem/_esm/chains/definitions/mainnet.js
|
|
60
|
+
var mainnet = /* @__PURE__ */ defineChain({
|
|
61
|
+
id: 1,
|
|
62
|
+
name: "Ethereum",
|
|
63
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
64
|
+
rpcUrls: {
|
|
65
|
+
default: {
|
|
66
|
+
http: ["https://eth.merkle.io"]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
blockExplorers: {
|
|
70
|
+
default: {
|
|
71
|
+
name: "Etherscan",
|
|
72
|
+
url: "https://etherscan.io",
|
|
73
|
+
apiUrl: "https://api.etherscan.io/api"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
contracts: {
|
|
77
|
+
ensRegistry: {
|
|
78
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
|
79
|
+
},
|
|
80
|
+
ensUniversalResolver: {
|
|
81
|
+
address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
|
|
82
|
+
blockCreated: 19258213
|
|
83
|
+
},
|
|
84
|
+
multicall3: {
|
|
85
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
86
|
+
blockCreated: 14353601
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// node_modules/.pnpm/viem@2.31.7_typescript@5.8.3/node_modules/viem/_esm/chains/definitions/sepolia.js
|
|
92
|
+
var sepolia = /* @__PURE__ */ defineChain({
|
|
93
|
+
id: 11155111,
|
|
94
|
+
name: "Sepolia",
|
|
95
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
96
|
+
rpcUrls: {
|
|
97
|
+
default: {
|
|
98
|
+
http: ["https://sepolia.drpc.org"]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
blockExplorers: {
|
|
102
|
+
default: {
|
|
103
|
+
name: "Etherscan",
|
|
104
|
+
url: "https://sepolia.etherscan.io",
|
|
105
|
+
apiUrl: "https://api-sepolia.etherscan.io/api"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
contracts: {
|
|
109
|
+
multicall3: {
|
|
110
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
111
|
+
blockCreated: 751532
|
|
112
|
+
},
|
|
113
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
114
|
+
ensUniversalResolver: {
|
|
115
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
116
|
+
blockCreated: 5317080
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
testnet: true
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// src/chains/supportedChains.ts
|
|
123
|
+
var PROD_SUPPORTED_CHAINS = {
|
|
124
|
+
// Mainnets
|
|
125
|
+
ethereum: mainnet
|
|
126
|
+
};
|
|
127
|
+
var STAGING_SUPPORTED_CHAINS = {
|
|
128
|
+
// Mainnets
|
|
129
|
+
ethereum: mainnet,
|
|
130
|
+
// Testnets
|
|
131
|
+
sepolia
|
|
132
|
+
};
|
|
133
|
+
var DEV_SUPPORTED_CHAINS = {
|
|
134
|
+
// Testnets
|
|
135
|
+
sepolia
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// src/chains/contracts.ts
|
|
139
|
+
var CONTRACTS = {
|
|
140
|
+
nftManager: {
|
|
141
|
+
read: {
|
|
142
|
+
arbitrum: ""
|
|
143
|
+
},
|
|
144
|
+
write: {
|
|
145
|
+
arbitrum: ""
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
tokenManager: {
|
|
149
|
+
read: {
|
|
150
|
+
arbitrum: ""
|
|
151
|
+
},
|
|
152
|
+
write: {
|
|
153
|
+
arbitrum: ""
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/features.ts
|
|
159
|
+
var FEATURES = {
|
|
160
|
+
// Authentication & Auth Providers
|
|
161
|
+
AUTH_GOOGLE: true,
|
|
162
|
+
AUTH_DISCORD: isDev
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// src/domains.ts
|
|
166
|
+
var DOMAINS = {
|
|
167
|
+
app: "https://plyaz.co.uk",
|
|
168
|
+
api: process.env.NEXT_PUBLIC_API_URL
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// src/constants.ts
|
|
172
|
+
var DEFAULT_LOCALE = "en";
|
|
173
|
+
var SUPPORTED_LOCALES = ["en", "es", "pt"];
|
|
174
|
+
|
|
175
|
+
// src/app.ts
|
|
176
|
+
var LANDING_PAGE_APP = {
|
|
177
|
+
NAME: "Plyaz",
|
|
178
|
+
VERSION: "1.0.0",
|
|
179
|
+
DEFAULT_LOCALE,
|
|
180
|
+
SUPPORTED_LOCALES
|
|
181
|
+
};
|
|
182
|
+
var WEB_APP = {
|
|
183
|
+
NAME: "Plyaz The App",
|
|
184
|
+
VERSION: "1.0.0",
|
|
185
|
+
DEFAULT_LOCALE,
|
|
186
|
+
SUPPORTED_LOCALES
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// src/security.ts
|
|
190
|
+
var SECURITY = {
|
|
191
|
+
BLOCKED_REGIONS: ["KP", "SY", "IR", "CU", "SD", "SO", "UA-CR", "UA-DP", "UA-LU"]
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// src/api.ts
|
|
195
|
+
var API_CONFIG = {};
|
|
196
|
+
var CACHE_CONFIG = {
|
|
197
|
+
// Cache TTL in seconds
|
|
198
|
+
ttl: {
|
|
199
|
+
short: 300,
|
|
200
|
+
// 5 minutes
|
|
201
|
+
medium: 1800,
|
|
202
|
+
// 30 minutes
|
|
203
|
+
long: 3600,
|
|
204
|
+
// 1 hour
|
|
205
|
+
extended: 86400
|
|
206
|
+
// 24 hours
|
|
207
|
+
},
|
|
208
|
+
// Cache keys
|
|
209
|
+
keys: {
|
|
210
|
+
user: "user:",
|
|
211
|
+
nft: "nft:",
|
|
212
|
+
blockchain: "blockchain:",
|
|
213
|
+
auth: "auth:"
|
|
214
|
+
},
|
|
215
|
+
// Redis configuration
|
|
216
|
+
redis: {
|
|
217
|
+
url: process.env.REDIS_URL,
|
|
218
|
+
keyPrefix: "plyaz:",
|
|
219
|
+
maxRetriesPerRequest: 3,
|
|
220
|
+
lazyConnect: true
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
var WEBHOOK_CONFIG = {};
|
|
224
|
+
|
|
225
|
+
exports.ALCHEMY_CONFIG = ALCHEMY_CONFIG;
|
|
226
|
+
exports.API_CONFIG = API_CONFIG;
|
|
227
|
+
exports.CACHE_CONFIG = CACHE_CONFIG;
|
|
228
|
+
exports.CONTRACTS = CONTRACTS;
|
|
229
|
+
exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
|
|
230
|
+
exports.DEV_SUPPORTED_CHAINS = DEV_SUPPORTED_CHAINS;
|
|
231
|
+
exports.DOMAINS = DOMAINS;
|
|
232
|
+
exports.FEATURES = FEATURES;
|
|
233
|
+
exports.LANDING_PAGE_APP = LANDING_PAGE_APP;
|
|
234
|
+
exports.OAUTH_PROVIDERS = OAUTH_PROVIDERS;
|
|
235
|
+
exports.PROD_SUPPORTED_CHAINS = PROD_SUPPORTED_CHAINS;
|
|
236
|
+
exports.SECURITY = SECURITY;
|
|
237
|
+
exports.STAGING_SUPPORTED_CHAINS = STAGING_SUPPORTED_CHAINS;
|
|
238
|
+
exports.SUPPORTED_LOCALES = SUPPORTED_LOCALES;
|
|
239
|
+
exports.WEBHOOK_CONFIG = WEBHOOK_CONFIG;
|
|
240
|
+
exports.WEB_APP = WEB_APP;
|
|
241
|
+
exports.isDev = isDev;
|
|
242
|
+
exports.isProd = isProd;
|
|
243
|
+
exports.isServer = isServer;
|
|
244
|
+
exports.isTest = isTest;
|
|
9
245
|
//# sourceMappingURL=index.cjs.map
|
|
10
246
|
//# 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","../node_modules/.pnpm/viem@2.31.7_typescript@5.8.3/node_modules/viem/utils/chain/defineChain.ts","../node_modules/.pnpm/viem@2.31.7_typescript@5.8.3/node_modules/viem/chains/definitions/mainnet.ts","../node_modules/.pnpm/viem@2.31.7_typescript@5.8.3/node_modules/viem/chains/definitions/sepolia.ts","../src/chains/supportedChains.ts","../src/chains/contracts.ts","../src/features.ts","../src/domains.ts","../src/constants.ts","../src/app.ts","../src/security.ts","../src/api.ts"],"names":[],"mappings":";;;;;;;AAEO,IAAM,QAAA,GAAW,OAAO,MAAA,KAAW;AACnC,IAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AACvC,IAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AACxC,IAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;;;ACHxC,IAAM,cAAA,GAAiB;AAAA,EAC5B,MAAA,EAAQ,QAAQ,GAAA,CAAI,uBAAA;AAAA,EACpB,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,CAAA,qCAAA,EAAwC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACrF,OAAA,EAAS,CAAA,yCAAA,EAA4C,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACxF,QAAA,EAAU,CAAA,qCAAA,EAAwC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACrF,QAAA,EAAU,CAAA,qCAAA,EAAwC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACrF,IAAA,EAAM,CAAA,sCAAA,EAAyC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IAClF,MAAA,EAAQ,CAAA,wCAAA,EAA2C,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA;AAAA;AAE1F;;;ACTO,IAAM,eAAA,GAAkB;AAAA,EAC7B,MAAA,EAAQ;AAAA,IACN,QAAA,EAAU,QAAQ,GAAA,CAAI,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ACX,oBAAA,EAAsB,CAAA;AAAA,IACtB,WAAA,EAAa;AAAA;AAEjB;AAEO,IAAM,iBAAiB","file":"index.cjs","sourcesContent":["/* eslint-disable no-undef */\n/* eslint-env node */\nexport const isServer = typeof window === 'undefined';\nexport const isDev = process.env.NODE_ENV === 'development';\nexport const isProd = process.env.NODE_ENV === 'production';\nexport const isTest = process.env.NODE_ENV === 'test';\n","/* eslint-disable no-undef */\n/* eslint-env node */\nexport const ALCHEMY_CONFIG = {\n apiKey: process.env.NEXT_PUBLIC_ALCHEMY_KEY!,\n rpcUrls: {\n ethereum: `https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n polygon: `https://polygon-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n optimism: `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n base: `https://base-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n solana: `https://solana-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n },\n};\n","/* eslint-disable no-undef */\n/* eslint-env node */\n\nexport const OAUTH_PROVIDERS = {\n google: {\n clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID!,\n clientSecret: process.env.GOOGLE_CLIENT_SECRET!,\n redirectUri: process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI!,\n scopes: ['openid', 'profile', 'email'],\n },\n discord: {\n clientId: process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID!,\n clientSecret: process.env.DISCORD_CLIENT_SECRET!,\n redirectUri: process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI!,\n scopes: ['identify', 'email'],\n },\n facebook: {\n clientId: process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID!,\n clientSecret: process.env.FACEBOOK_CLIENT_SECRET!,\n redirectUri: process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI!,\n scopes: ['public_profile', 'email'],\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","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","/* eslint-disable @typescript-eslint/naming-convention */\nimport { isDev } from './env';\n\nexport const FEATURES = {\n // Authentication & Auth Providers\n AUTH_GOOGLE: true,\n AUTH_DISCORD: isDev,\n} as const;\n","/* eslint-disable no-undef */\n/* eslint-env node */\nexport const DOMAINS = {\n app: 'https://plyaz.co.uk',\n api: process.env.NEXT_PUBLIC_API_URL!,\n} as const;\n","export const DEFAULT_LOCALE = 'en';\nexport const SUPPORTED_LOCALES = ['en', 'es', 'pt'] as const;\n","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","/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable no-undef */\n/* eslint-env node */\n\nexport 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: process.env.REDIS_URL!,\n keyPrefix: 'plyaz:',\n maxRetriesPerRequest: 3,\n lazyConnect: true,\n },\n} as const;\n\nexport const WEBHOOK_CONFIG = {} as const;\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './env';
|
|
2
|
+
export * from './providers/alchemy';
|
|
3
|
+
export * from './providers/oauth';
|
|
4
|
+
export * from './chains/supportedChains';
|
|
5
|
+
export * from './chains/contracts';
|
|
6
|
+
export * from './features';
|
|
7
|
+
export * from './domains';
|
|
8
|
+
export * from './app';
|
|
9
|
+
export * from './security';
|
|
10
|
+
export * from './constants';
|
|
11
|
+
export * from './api';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,149 @@
|
|
|
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 = process.env.NODE_ENV === "development";
|
|
8
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
9
|
+
var isTest = process.env.NODE_ENV === "test";
|
|
10
|
+
|
|
11
|
+
// src/providers/alchemy.ts
|
|
12
|
+
var ALCHEMY_CONFIG = {
|
|
13
|
+
apiKey: process.env.NEXT_PUBLIC_ALCHEMY_KEY,
|
|
14
|
+
rpcUrls: {
|
|
15
|
+
ethereum: `https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
16
|
+
polygon: `https://polygon-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
17
|
+
arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
18
|
+
optimism: `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
19
|
+
base: `https://base-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,
|
|
20
|
+
solana: `https://solana-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// src/providers/oauth.ts
|
|
25
|
+
var OAUTH_PROVIDERS = {
|
|
26
|
+
google: {
|
|
27
|
+
clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
|
|
28
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
|
29
|
+
redirectUri: process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI,
|
|
30
|
+
scopes: ["openid", "profile", "email"]
|
|
31
|
+
},
|
|
32
|
+
discord: {
|
|
33
|
+
clientId: process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID,
|
|
34
|
+
clientSecret: process.env.DISCORD_CLIENT_SECRET,
|
|
35
|
+
redirectUri: process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI,
|
|
36
|
+
scopes: ["identify", "email"]
|
|
37
|
+
},
|
|
38
|
+
facebook: {
|
|
39
|
+
clientId: process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID,
|
|
40
|
+
clientSecret: process.env.FACEBOOK_CLIENT_SECRET,
|
|
41
|
+
redirectUri: process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI,
|
|
42
|
+
scopes: ["public_profile", "email"]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var PROD_SUPPORTED_CHAINS = {
|
|
46
|
+
// Mainnets
|
|
47
|
+
ethereum: mainnet
|
|
48
|
+
};
|
|
49
|
+
var STAGING_SUPPORTED_CHAINS = {
|
|
50
|
+
// Mainnets
|
|
51
|
+
ethereum: mainnet,
|
|
52
|
+
// Testnets
|
|
53
|
+
sepolia
|
|
54
|
+
};
|
|
55
|
+
var DEV_SUPPORTED_CHAINS = {
|
|
56
|
+
// Testnets
|
|
57
|
+
sepolia
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// src/chains/contracts.ts
|
|
61
|
+
var CONTRACTS = {
|
|
62
|
+
nftManager: {
|
|
63
|
+
read: {
|
|
64
|
+
arbitrum: ""
|
|
65
|
+
},
|
|
66
|
+
write: {
|
|
67
|
+
arbitrum: ""
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
tokenManager: {
|
|
71
|
+
read: {
|
|
72
|
+
arbitrum: ""
|
|
73
|
+
},
|
|
74
|
+
write: {
|
|
75
|
+
arbitrum: ""
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/features.ts
|
|
81
|
+
var FEATURES = {
|
|
82
|
+
// Authentication & Auth Providers
|
|
83
|
+
AUTH_GOOGLE: true,
|
|
84
|
+
AUTH_DISCORD: isDev
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// src/domains.ts
|
|
88
|
+
var DOMAINS = {
|
|
89
|
+
app: "https://plyaz.co.uk",
|
|
90
|
+
api: process.env.NEXT_PUBLIC_API_URL
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// src/constants.ts
|
|
94
|
+
var DEFAULT_LOCALE = "en";
|
|
95
|
+
var SUPPORTED_LOCALES = ["en", "es", "pt"];
|
|
96
|
+
|
|
97
|
+
// src/app.ts
|
|
98
|
+
var LANDING_PAGE_APP = {
|
|
99
|
+
NAME: "Plyaz",
|
|
100
|
+
VERSION: "1.0.0",
|
|
101
|
+
DEFAULT_LOCALE,
|
|
102
|
+
SUPPORTED_LOCALES
|
|
103
|
+
};
|
|
104
|
+
var WEB_APP = {
|
|
105
|
+
NAME: "Plyaz The App",
|
|
106
|
+
VERSION: "1.0.0",
|
|
107
|
+
DEFAULT_LOCALE,
|
|
108
|
+
SUPPORTED_LOCALES
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// src/security.ts
|
|
112
|
+
var SECURITY = {
|
|
113
|
+
BLOCKED_REGIONS: ["KP", "SY", "IR", "CU", "SD", "SO", "UA-CR", "UA-DP", "UA-LU"]
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// src/api.ts
|
|
117
|
+
var API_CONFIG = {};
|
|
118
|
+
var CACHE_CONFIG = {
|
|
119
|
+
// Cache TTL in seconds
|
|
120
|
+
ttl: {
|
|
121
|
+
short: 300,
|
|
122
|
+
// 5 minutes
|
|
123
|
+
medium: 1800,
|
|
124
|
+
// 30 minutes
|
|
125
|
+
long: 3600,
|
|
126
|
+
// 1 hour
|
|
127
|
+
extended: 86400
|
|
128
|
+
// 24 hours
|
|
129
|
+
},
|
|
130
|
+
// Cache keys
|
|
131
|
+
keys: {
|
|
132
|
+
user: "user:",
|
|
133
|
+
nft: "nft:",
|
|
134
|
+
blockchain: "blockchain:",
|
|
135
|
+
auth: "auth:"
|
|
136
|
+
},
|
|
137
|
+
// Redis configuration
|
|
138
|
+
redis: {
|
|
139
|
+
url: process.env.REDIS_URL,
|
|
140
|
+
keyPrefix: "plyaz:",
|
|
141
|
+
maxRetriesPerRequest: 3,
|
|
142
|
+
lazyConnect: true
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
var WEBHOOK_CONFIG = {};
|
|
5
146
|
|
|
6
|
-
export {
|
|
147
|
+
export { ALCHEMY_CONFIG, API_CONFIG, CACHE_CONFIG, CONTRACTS, DEFAULT_LOCALE, DEV_SUPPORTED_CHAINS, DOMAINS, FEATURES, LANDING_PAGE_APP, OAUTH_PROVIDERS, PROD_SUPPORTED_CHAINS, SECURITY, STAGING_SUPPORTED_CHAINS, SUPPORTED_LOCALES, WEBHOOK_CONFIG, WEB_APP, isDev, isProd, isServer, isTest };
|
|
7
148
|
//# sourceMappingURL=index.js.map
|
|
8
149
|
//# 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/supportedChains.ts","../src/chains/contracts.ts","../src/features.ts","../src/domains.ts","../src/constants.ts","../src/app.ts","../src/security.ts","../src/api.ts"],"names":[],"mappings":";;;;;AAEO,IAAM,QAAA,GAAW,OAAO,MAAA,KAAW;AACnC,IAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AACvC,IAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;AACxC,IAAM,MAAA,GAAS,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa;;;ACHxC,IAAM,cAAA,GAAiB;AAAA,EAC5B,MAAA,EAAQ,QAAQ,GAAA,CAAI,uBAAA;AAAA,EACpB,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,CAAA,qCAAA,EAAwC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACrF,OAAA,EAAS,CAAA,yCAAA,EAA4C,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACxF,QAAA,EAAU,CAAA,qCAAA,EAAwC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACrF,QAAA,EAAU,CAAA,qCAAA,EAAwC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IACrF,IAAA,EAAM,CAAA,sCAAA,EAAyC,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,CAAA;AAAA,IAClF,MAAA,EAAQ,CAAA,wCAAA,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AA,CAAI,SAAA;AAAA,IACjB,SAAA,EAAW,QAAA;AAAA,IACX,oBAAA,EAAsB,CAAA;AAAA,IACtB,WAAA,EAAa;AAAA;AAEjB;AAEO,IAAM,iBAAiB","file":"index.js","sourcesContent":["/* eslint-disable no-undef */\n/* eslint-env node */\nexport const isServer = typeof window === 'undefined';\nexport const isDev = process.env.NODE_ENV === 'development';\nexport const isProd = process.env.NODE_ENV === 'production';\nexport const isTest = process.env.NODE_ENV === 'test';\n","/* eslint-disable no-undef */\n/* eslint-env node */\nexport const ALCHEMY_CONFIG = {\n apiKey: process.env.NEXT_PUBLIC_ALCHEMY_KEY!,\n rpcUrls: {\n ethereum: `https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n polygon: `https://polygon-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n arbitrum: `https://arb-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n optimism: `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n base: `https://base-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n solana: `https://solana-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_KEY}`,\n },\n};\n","/* eslint-disable no-undef */\n/* eslint-env node */\n\nexport const OAUTH_PROVIDERS = {\n google: {\n clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID!,\n clientSecret: process.env.GOOGLE_CLIENT_SECRET!,\n redirectUri: process.env.NEXT_PUBLIC_GOOGLE_REDIRECT_URI!,\n scopes: ['openid', 'profile', 'email'],\n },\n discord: {\n clientId: process.env.NEXT_PUBLIC_DISCORD_CLIENT_ID!,\n clientSecret: process.env.DISCORD_CLIENT_SECRET!,\n redirectUri: process.env.NEXT_PUBLIC_DISCORD_REDIRECT_URI!,\n scopes: ['identify', 'email'],\n },\n facebook: {\n clientId: process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID!,\n clientSecret: process.env.FACEBOOK_CLIENT_SECRET!,\n redirectUri: process.env.NEXT_PUBLIC_FACEBOOK_REDIRECT_URI!,\n scopes: ['public_profile', 'email'],\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","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","/* eslint-disable @typescript-eslint/naming-convention */\nimport { isDev } from './env';\n\nexport const FEATURES = {\n // Authentication & Auth Providers\n AUTH_GOOGLE: true,\n AUTH_DISCORD: isDev,\n} as const;\n","/* eslint-disable no-undef */\n/* eslint-env node */\nexport const DOMAINS = {\n app: 'https://plyaz.co.uk',\n api: process.env.NEXT_PUBLIC_API_URL!,\n} as const;\n","export const DEFAULT_LOCALE = 'en';\nexport const SUPPORTED_LOCALES = ['en', 'es', 'pt'] as const;\n","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","/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable no-undef */\n/* eslint-env node */\n\nexport 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: process.env.REDIS_URL!,\n keyPrefix: 'plyaz:',\n maxRetriesPerRequest: 3,\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": "
|
|
3
|
+
"version": "1.0.0",
|
|
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