@fxhash/config 0.0.9 → 0.0.11

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.
Files changed (75) hide show
  1. package/README.md +18 -2
  2. package/dist/index.d.ts +410 -10
  3. package/dist/index.js +817 -56
  4. package/dist/index.js.map +1 -1
  5. package/package.json +19 -20
  6. package/dist/api/eth.cjs +0 -9
  7. package/dist/api/eth.cjs.map +0 -1
  8. package/dist/api/eth.d.ts +0 -10
  9. package/dist/api/eth.js +0 -9
  10. package/dist/api/eth.js.map +0 -1
  11. package/dist/api/fxhash.cjs +0 -11
  12. package/dist/api/fxhash.cjs.map +0 -1
  13. package/dist/api/fxhash.d.ts +0 -37
  14. package/dist/api/fxhash.js +0 -11
  15. package/dist/api/fxhash.js.map +0 -1
  16. package/dist/api/tezos.cjs +0 -9
  17. package/dist/api/tezos.cjs.map +0 -1
  18. package/dist/api/tezos.d.ts +0 -9
  19. package/dist/api/tezos.js +0 -9
  20. package/dist/api/tezos.js.map +0 -1
  21. package/dist/chunk-2Z36EJVM.cjs +0 -159
  22. package/dist/chunk-2Z36EJVM.cjs.map +0 -1
  23. package/dist/chunk-3HYMO7HS.js +0 -13
  24. package/dist/chunk-3HYMO7HS.js.map +0 -1
  25. package/dist/chunk-3U7S5KQ5.js +0 -45
  26. package/dist/chunk-3U7S5KQ5.js.map +0 -1
  27. package/dist/chunk-6LCEWPDB.js +0 -80
  28. package/dist/chunk-6LCEWPDB.js.map +0 -1
  29. package/dist/chunk-7WY5VFHS.js +0 -27
  30. package/dist/chunk-7WY5VFHS.js.map +0 -1
  31. package/dist/chunk-BDNQHSCV.cjs +0 -13
  32. package/dist/chunk-BDNQHSCV.cjs.map +0 -1
  33. package/dist/chunk-HFJTQFU5.cjs +0 -80
  34. package/dist/chunk-HFJTQFU5.cjs.map +0 -1
  35. package/dist/chunk-LYBPFYQE.cjs +0 -81
  36. package/dist/chunk-LYBPFYQE.cjs.map +0 -1
  37. package/dist/chunk-M7HZ3LKE.js +0 -19
  38. package/dist/chunk-M7HZ3LKE.js.map +0 -1
  39. package/dist/chunk-NSIM63EC.cjs +0 -27
  40. package/dist/chunk-NSIM63EC.cjs.map +0 -1
  41. package/dist/chunk-OX246A4J.js +0 -81
  42. package/dist/chunk-OX246A4J.js.map +0 -1
  43. package/dist/chunk-VOYFMWZ7.js +0 -159
  44. package/dist/chunk-VOYFMWZ7.js.map +0 -1
  45. package/dist/chunk-VUNWHN5H.cjs +0 -19
  46. package/dist/chunk-VUNWHN5H.cjs.map +0 -1
  47. package/dist/chunk-XQC264QN.cjs +0 -45
  48. package/dist/chunk-XQC264QN.cjs.map +0 -1
  49. package/dist/config.cjs +0 -19
  50. package/dist/config.cjs.map +0 -1
  51. package/dist/config.d.ts +0 -79
  52. package/dist/config.js +0 -19
  53. package/dist/config.js.map +0 -1
  54. package/dist/contracts/eth.cjs +0 -9
  55. package/dist/contracts/eth.cjs.map +0 -1
  56. package/dist/contracts/eth.d.ts +0 -28
  57. package/dist/contracts/eth.js +0 -9
  58. package/dist/contracts/eth.js.map +0 -1
  59. package/dist/contracts/tezos.cjs +0 -9
  60. package/dist/contracts/tezos.cjs.map +0 -1
  61. package/dist/contracts/tezos.d.ts +0 -41
  62. package/dist/contracts/tezos.js +0 -9
  63. package/dist/contracts/tezos.js.map +0 -1
  64. package/dist/index.cjs +0 -62
  65. package/dist/index.cjs.map +0 -1
  66. package/dist/types.cjs +0 -7
  67. package/dist/types.cjs.map +0 -1
  68. package/dist/types.d.ts +0 -19
  69. package/dist/types.js +0 -7
  70. package/dist/types.js.map +0 -1
  71. package/dist/utils/index.cjs +0 -15
  72. package/dist/utils/index.cjs.map +0 -1
  73. package/dist/utils/index.d.ts +0 -12
  74. package/dist/utils/index.js +0 -15
  75. package/dist/utils/index.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,62 +1,823 @@
1
- import {
2
- devConfig,
3
- fxhashConfig,
4
- localConfig,
5
- prdConfig
6
- } from "./chunk-VOYFMWZ7.js";
7
- import {
8
- BlockchainIdentifiers
9
- } from "./chunk-3HYMO7HS.js";
10
- import {
11
- ethTestnetApis
12
- } from "./chunk-M7HZ3LKE.js";
13
- import {
14
- fxhashDevApis,
15
- fxhashPrdApis
16
- } from "./chunk-6LCEWPDB.js";
17
- import {
18
- tezosMainnetApis,
19
- tezosTestnetApis
20
- } from "./chunk-7WY5VFHS.js";
21
- import {
22
- ethTestnetContracts
23
- } from "./chunk-3U7S5KQ5.js";
24
- import {
25
- tezosMainnetContracts,
26
- tezosTestnetContracts
27
- } from "./chunk-OX246A4J.js";
28
-
29
- // src/index.ts
30
- var isProd = (() => {
31
- return process.env.FXHASH_ENV === "prd" || process.env.FXHASH_ENV === "production" || process.env.NEXT_PUBLIC_FXHASH_ENV === "prd" || process.env.NEXT_PUBLIC_FXHASH_ENV === "production" || process.env.REACT_APP_FXHASH_ENV === "prd" || process.env.REACT_APP_FXHASH_ENV === "production";
1
+ import { failure, success } from "@fxhash/utils";
2
+ import { RichError, isRichErrorMessages } from "@fxhash/errors";
3
+
4
+ //#region rolldown:runtime
5
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
8
+ });
9
+
10
+ //#endregion
11
+ //#region src/api/eth.ts
12
+ const ethTestnetApis = {
13
+ rpcs: ["https://eth-sepolia.g.alchemy.com/v2/fATxHNjMh0rR9DnHCtZKDpPPxkEY48Qb"],
14
+ reservoir: "https://api-sepolia.reservoir.tools",
15
+ safe: "https://safe-transaction-sepolia.safe.global",
16
+ whitelist: "http://localhost:9999/whitelist/new",
17
+ alchemy: { rpc: "https://eth-sepolia.g.alchemy.com/v2/xTtlsglqRKcFwSkg2bilqp7U2smOt3g9" }
18
+ };
19
+ const ethMainnetApis = {
20
+ rpcs: ["https://eth-mainnet.g.alchemy.com/v2/xTtlsglqRKcFwSkg2bilqp7U2smOt3g9"],
21
+ reservoir: "https://api.reservoir.tools",
22
+ safe: "https://safe-transaction-mainnet.safe.global/",
23
+ whitelist: "https://api.v2.dev.fxhash-dev.xyz/whitelist/new",
24
+ alchemy: { rpc: "https://eth-mainnet.g.alchemy.com/v2/xTtlsglqRKcFwSkg2bilqp7U2smOt3g9" }
25
+ };
26
+
27
+ //#endregion
28
+ //#region src/api/tezos.ts
29
+ const tezosTestnetApis = {
30
+ tzkt: "https://api.ghostnet.tzkt.io/v1/",
31
+ tzktPro: "https://api.ghostnet.tzkt.io/v1/",
32
+ tzktWebsite: "https://ghostnet.tzkt.io/",
33
+ rpcs: [
34
+ "https://ghostnet.ecadinfra.com",
35
+ "https://ghostnet.smartpy.io",
36
+ "https://ghostnet.tezos.marigold.dev/"
37
+ ]
38
+ };
39
+ const tezosMainnetApis = {
40
+ tzkt: "https://api.tzkt.io/v1/",
41
+ tzktPro: "https://pro.tzkt.io/v1/",
42
+ tzktWebsite: "https://tzkt.io/",
43
+ rpcs: [
44
+ "https://rpc1.fxhash.xyz",
45
+ "https://mainnet.smartpy.io",
46
+ "https://mainnet.api.tez.ie",
47
+ "https://teznode.letzbake.com"
48
+ ]
49
+ };
50
+
51
+ //#endregion
52
+ //#region src/helpers.ts
53
+ const HOST_LOCAL = "localhost";
54
+ const HOST_DOCKER_INTERNAL = "host.docker.internal";
55
+ function getDockerInternalUrl(url) {
56
+ return url.replace(HOST_LOCAL, HOST_DOCKER_INTERNAL);
57
+ }
58
+ const isProd = (() => {
59
+ return process.env.FXHASH_ENV === "prd" || process.env.FXHASH_ENV === "production" || process.env.NEXT_PUBLIC_FXHASH_ENV === "prd" || process.env.NEXT_PUBLIC_FXHASH_ENV === "production" || process.env.REACT_APP_FXHASH_ENV === "prd" || process.env.REACT_APP_FXHASH_ENV === "production" || process.env.VITE_FXHASH_ENV === "prd" || process.env.VITE_FXHASH_ENV === "production";
32
60
  })();
33
- var isLocal = (() => {
34
- return process.env.FXHASH_ENV === "local" || process.env.NEXT_PUBLIC_FXHASH_ENV === "local" || process.env.REACT_APP_FXHASH_ENV === "local";
61
+ const isLocal = (() => {
62
+ return process.env.FXHASH_ENV === "local" || process.env.NEXT_PUBLIC_FXHASH_ENV === "local" || process.env.REACT_APP_FXHASH_ENV === "local" || process.env.VITE_FXHASH_ENV === "local";
35
63
  })();
36
- var config = isProd ? prdConfig : isLocal ? localConfig : devConfig;
64
+ const isDockerLocal = (() => {
65
+ const isBrowser = typeof window !== "undefined";
66
+ if (isBrowser) return false;
67
+ let fs;
68
+ try {
69
+ fs = __require("fs");
70
+ } catch (e) {
71
+ return false;
72
+ }
73
+ if (!fs) return false;
74
+ return isLocal && fs.existsSync("/.dockerenv");
75
+ })();
76
+ function getEnv() {
77
+ if (isProd) return "prd";
78
+ if (isLocal) return isDockerLocal ? "localDocker" : "local";
79
+ return "dev";
80
+ }
81
+
82
+ //#endregion
83
+ //#region src/api/fxhash.ts
84
+ const fxhashDevApis = {
85
+ website: "https://beta.fxhash-dev.xyz",
86
+ docs: "https://docs.fxhash.xyz",
87
+ main: "https://api.v2-temp.dev.fxhash-dev.xyz/graphql",
88
+ hasura: "https://api.v2.dev.fxhash-dev.xyz",
89
+ hasuraGql: "https://api.v2.dev.fxhash-dev.xyz/v1/graphql",
90
+ file: "https://file-api.fxhash-dev.xyz",
91
+ fileInternal: "http://fxhash-multichain-dev-testnet-file-api.fxhash-multichain-dev-testnet.svc.cluster.local:4004",
92
+ walletInternal: "http://fxhash-multichain-dev-testnet-wallet-api.fxhash-multichain-dev-testnet.svc.cluster.local:3208",
93
+ fsEmulator: "https://file-api.fxhash-dev.xyz/fs",
94
+ extract: "https://extract.fxhash-dev.xyz",
95
+ extractInternal: "http://fxhash-dev-testnet-extract-balancer.fxhash-dev-testnet.svc.cluster.local:4017",
96
+ media: "https://media.dev.fxhash-dev.xyz",
97
+ ethMetadata: "https://media.dev.fxhash-dev.xyz/metadata/ethereum/",
98
+ ipfsInternal: "http://fxhash-dev-testnet-ipfs-cluster-api.fxhash-dev-testnet.svc.cluster.local:9094",
99
+ ipfsGateway: "https://gateway.fxhash-dev.xyz",
100
+ ipfsGatewaySafe: "https://gateway.fxhash-dev2.xyz",
101
+ ipfsGatewayInternal: "http://fxhash-dev-testnet-ipfs-cluster-gateway.fxhash-dev-testnet.svc.cluster.local:8080",
102
+ onchfsProxy: "https://onchfs.fxhash-dev2.xyz",
103
+ opensea: "https://testnets-api.opensea.io/api/v2",
104
+ authority: { api: "NONE" },
105
+ capture: {
106
+ lambdas: {
107
+ small: "https://u5not5l323zczuwnrzxwkt34ra0eyidj.lambda-url.us-east-1.on.aws/",
108
+ medium: "https://jgfz7a6km7fsqonej2sp3lqwvu0utnyy.lambda-url.us-east-1.on.aws/",
109
+ large: "https://fzezvbp2f74yturkj4akjyrq3e0zswhb.lambda-url.us-east-1.on.aws/"
110
+ },
111
+ proxy: {
112
+ ipfs: "ipfs://Qme6E5z1GDqrHyPomGEw5LChxmE9pdEYGWjwxrv6ZgwZRo",
113
+ onchfs: "onchfs://4287364ed3219d3f2f77302a71eff0db49e971058ef87f163981ef89a445b143"
114
+ }
115
+ },
116
+ events: { liveBackend: "_NONE" },
117
+ indexer: {
118
+ tez: "http://fxhash-multichain-dev-testnet-indexer-v2.fxhash-multichain-dev-testnet.svc.cluster.local:4001",
119
+ eth: "http://fxhash-multichain-dev-testnet-eth-indexer.fxhash-multichain-dev-testnet.svc.cluster.local:3000",
120
+ base: "http://fxhash-multichain-dev-testnet-base-indexer.fxhash-multichain-dev-testnet.svc.cluster.local:3000"
121
+ }
122
+ };
123
+ const fxhashLocalApis = {
124
+ ...fxhashDevApis,
125
+ website: "http://localhost:3200",
126
+ hasura: "http://localhost:8888",
127
+ hasuraGql: "http://localhost:8888/v1/graphql",
128
+ fileInternal: fxhashDevApis.file,
129
+ ipfsGatewayInternal: fxhashDevApis.ipfsGateway,
130
+ walletInternal: "http://host.docker.internal:3208"
131
+ };
132
+ const fxhashLocalDockerApis = {
133
+ ...fxhashLocalApis,
134
+ hasura: getDockerInternalUrl(fxhashLocalApis.hasura),
135
+ hasuraGql: getDockerInternalUrl(fxhashLocalApis.hasuraGql)
136
+ };
137
+ const fxhashPrdApis = {
138
+ website: "https://www.fxhash.xyz",
139
+ docs: "https://docs.fxhash.xyz",
140
+ main: "https://api.v2-temp.fxhash.xyz/graphql",
141
+ hasura: "https://api.v2.fxhash.xyz",
142
+ hasuraGql: "https://api.v2.fxhash.xyz/v1/graphql",
143
+ file: "https://file-api.fxhash.xyz",
144
+ fileInternal: "http://fxhash-multichain-prd-file-api.fxhash-multichain-prd.svc.cluster.local:4004",
145
+ walletInternal: "http://fxhash-multichain-prd-wallet-api.fxhash-multichain-prd.svc.cluster.local:3208",
146
+ fsEmulator: "https://file-api.fxhash.xyz/fs",
147
+ extract: "https://extract.fxhash.xyz",
148
+ extractInternal: "http://fxhash-prd-extract-balancer.fxhash-prd.svc.cluster.local:4017",
149
+ media: "https://media.fxhash.xyz",
150
+ ethMetadata: "https://media.fxhash.xyz/metadata/ethereum/",
151
+ ipfsInternal: "http://fxhash-prd-ipfs-cluster-api.fxhash-prd.svc.cluster.local:9094",
152
+ ipfsGateway: "https://gateway.fxhash.xyz",
153
+ ipfsGatewaySafe: "https://gateway.fxhash2.xyz",
154
+ ipfsGatewayInternal: "http://fxhash-prd-ipfs-cluster-gateway.fxhash-prd.svc.cluster.local:8080",
155
+ onchfsProxy: "https://onchfs.fxhash2.xyz",
156
+ opensea: "https://api.opensea.io/api/v2",
157
+ authority: { api: "NONE" },
158
+ capture: {
159
+ lambdas: {
160
+ small: "https://7sz7knaaw3obgqxjyv3m4e5myu0lsbdp.lambda-url.us-east-1.on.aws/",
161
+ medium: "https://tuupcq6eesbfk4veuzdfrhu7zm0zwuqy.lambda-url.us-east-1.on.aws/",
162
+ large: "https://bojj24y6ucxmsyfi4uccdmiliy0dzhji.lambda-url.us-east-1.on.aws/"
163
+ },
164
+ proxy: {
165
+ ipfs: "ipfs://Qme6E5z1GDqrHyPomGEw5LChxmE9pdEYGWjwxrv6ZgwZRo",
166
+ onchfs: "onchfs://4287364ed3219d3f2f77302a71eff0db49e971058ef87f163981ef89a445b143"
167
+ }
168
+ },
169
+ events: { liveBackend: "_NONE" },
170
+ indexer: {
171
+ tez: "http://fxhash-multichain-prd-indexer-v2.fxhash-multichain-prd.svc.cluster.local:4001",
172
+ eth: "http://fxhash-multichain-prd-eth-indexer.fxhash-multichain-prd.svc.cluster.local:3000",
173
+ base: "http://fxhash-multichain-prd-base-indexer.fxhash-multichain-prd.svc.cluster.local:3000"
174
+ }
175
+ };
176
+ const fxEnvToApisMap = {
177
+ local: fxhashLocalApis,
178
+ localDocker: fxhashLocalDockerApis,
179
+ dev: fxhashDevApis,
180
+ prd: fxhashPrdApis
181
+ };
182
+ /**
183
+ * Given some env, returns the associated APIs config.
184
+ */
185
+ function fxApisByEnv(env) {
186
+ return fxEnvToApisMap[env];
187
+ }
188
+
189
+ //#endregion
190
+ //#region src/contracts/tezos.ts
191
+ const tezosTestnetContracts = {
192
+ allowed_mint: "KT1QwfqMUDRYVyxo9KhunY5YCx9qQ9LWcswr",
193
+ allowed_mint_issuer: "KT1WDByFKQmgVynxSr2rzdijs5aSs7mo7eBM",
194
+ allowed_mint_issuer_v3: "KT1S3UqrLgMpVivNWWmBUnkPCaSFHDJ4HYvb",
195
+ allowed_mint_v3: "KT1HUE2A6CHNw4NZZBWjJyG38nysWWfusagu",
196
+ articles: "KT1HV8NXUCKWC1tWNHSD8LPPiKPshQuXvb8r",
197
+ card_proxy: "KT1R6N27Qdw4RqeSUnYkw436uZrFSRWtxqbd",
198
+ collaboration_factory: "KT1WFXts7jwxpD9uGDKzyqTUTFaG222xmjoZ",
199
+ consumable_database: "KT1FP9y1PJpJkXhdJCgYZhVbj9UBpxnA57Bx",
200
+ cycles: "KT1BJBcvtgZM2Kf4rUapmp4AhXtWCmznxd6F",
201
+ gentk_v1: "KT1ExHjELnDuat9io3HkDcrBhHmek7h8EVXG",
202
+ gentk_v1_data: "KT1SquPSN9oiMUWHG9coKRJAwz8Afe4c6izT",
203
+ gentk_v2: "KT1NkZho1yRkDdQnN4Mz93sDYyY2pPrEHTNs",
204
+ gentk_v3: "KT1TtVAyjh4Ahdm8sLZwFnL7tqoLf59XrK2h",
205
+ issuer_tickets: "KT19PBsvmB2CwFqXftzb5gNJfxrEDFdSxGKZ",
206
+ issuer_v0: "KT1PyfrDD85RxUWz8dMHoC92MxdPzecSQ5t9",
207
+ issuer_v1: "KT1QwWVZogqPZZtGSVxGpLkEWar7LFvAsMdd",
208
+ issuer_v2: "KT1Sy7X6TubmZ39G8CHVrUcxjc3jiF68P8oB",
209
+ issuer_v3: "KT1DfymMp3qD5Pd5ujPjp7UsQbppY9yY1Hbf",
210
+ marketplace_v1: "KT1DbivePcuUzCp5RaAQWxPSLV9G2Ys4faUR",
211
+ marketplace_v2: "KT1HFYtf4vNCr4xRDZxLKc5asUdCsPUTTW9R",
212
+ marketplace_v3: "KT1J6rt4d9U785DZWYEPvQ2fR1e71gxP42Lj",
213
+ moderation_articles: "KT1Qg78fa81Xyjh65yNqUgVucubHUyq6VmgL",
214
+ moderation_team: "KT1RsfyWzHs1EEWMzFLmKnJTQwPqRzsnF3Dp",
215
+ moderation_token: "KT1PokFR36CcXKh3jUnjncabcuPWm5BMiqjt",
216
+ moderation_token_v3: "KT1C1J38YR6eDvRBDEDaypptCFda9aH7FRbJ",
217
+ moderation_user: "KT1Q3s7mYpscCnwsyndrVZg9WqBCmw99n37g",
218
+ pricing_dutch_auction: "KT1BqikbUisiBBd9WvPiqnTwLY8Pm68p2Aua",
219
+ pricing_dutch_auction_v3: "KT1QCboxZ28SqsfyZWTDrkSpZzU6xjZXBsFb",
220
+ pricing_fixed: "KT1PAsf9Zc9FGJA9iLE1Ab2vPkMDsh4hyZVi",
221
+ pricing_fixed_v3: "KT1Mqyy5JPknNzNJtgF93SHpFHv4VcYrNZry",
222
+ randomizer: "KT1QmdsrJWJgK3VXid8q7D4sPipVoc9jh12x",
223
+ randomizer_v2: "KT1Eow4nBY3B9EhWcX1aEXva67VkNFfP1Tq6",
224
+ token_moderation: "KT1BHfPDMRp2q48ZkmmnK7TRzQRdFnp6XVKq",
225
+ treasury: "KT1MbDbRhZPs5TzZEXkT142ePoccFHfohBoo",
226
+ user_moderation: "KT1LmZjoitx2itnB1qCbHMrT3V64RbuSPf3a",
227
+ user_register: "KT1XaikgmBDQANBvkFqyFhSpgAZJAXpiDFGE",
228
+ onchfs_files: "KT1FA8AGGcJha6S6MqfBUiibwTaYhK8u7s9Q"
229
+ };
230
+ const tezosMainnetContracts = {
231
+ allowed_mint: "KT1VDQwskdfHkSbA9W6CSEnxnh1u1XU8K8Gu",
232
+ allowed_mint_issuer: "KT1Djz5ix2yEGmV7PMq3GYq17TvMMkd1anT2",
233
+ allowed_mint_issuer_v3: "KT1LJ4R4xoEWMgTjrGrdHJAeHLYFaB4RsoVK",
234
+ allowed_mint_v3: "KT1KgEjxqfRCMwtCGifT6fDPwC35RptTUEvE",
235
+ articles: "KT1GtbuswcNMGhHF2TSuH1Yfaqn16do8Qtva",
236
+ card_proxy: "KT1DQGSRsgHcf2TPdKGc4qm5AT9JprJCAo7j",
237
+ collaboration_factory: "KT1JrUPSCt1r2MB2J7Lk2KwiWSYr3Mr414ck",
238
+ consumable_database: "KT1Mbfkqh5EhebWuMvqAfUPTpgiBPwmQCDSD",
239
+ cycles: "KT1BgD9SPfysnMz3vkfm6ZEaGFKCVcE5ay91",
240
+ gentk_v1: "KT1KEa8z6vWXDJrVqtMrAeDVzsvxat3kHaCE",
241
+ gentk_v1_data: "KT1WRpPyXHSCbTfDQFWVXbMpxxvf7Y7KChxc",
242
+ gentk_v2: "KT1U6EHmNxJTkvaWJ4ThczG4FSDaHC21ssvi",
243
+ gentk_v3: "KT1EfsNuqwLAWDd3o4pvfUx1CAh5GMdTrRvr",
244
+ issuer_tickets: "KT19etLCjCCzTLFFAxsxLFsVYMRPetr2bTD5",
245
+ issuer_v0: "KT1AEVuykWeuuFX7QkEAMNtffzwhe1Z98hJS",
246
+ issuer_v1: "KT1XCoGnfupWk7Sp8536EfrxcP73LmT68Nyr",
247
+ issuer_v2: "KT1BJC12dG17CVvPKJ1VYaNnaT5mzfnUTwXv",
248
+ issuer_v3: "KT1Xpmp15KfqoePNW9HczFmqaGNHwadV2a3b",
249
+ marketplace_v1: "KT1Xo5B7PNBAeynZPmca4bRh6LQow4og1Zb9",
250
+ marketplace_v2: "KT1GbyoDi7H1sfXmimXpptZJuCdHMh66WS9u",
251
+ marketplace_v3: "KT1M1NyU9X4usEimt2f3kDaijZnDMNBu42Ja",
252
+ moderation_articles: "KT1A36z7nG4zPDbhjyrzhYf9SCn5ipPZeRMQ",
253
+ moderation_team: "KT1FvGQcPxzuJkJsdWFQiGkueSNT5mqpFDrf",
254
+ moderation_token: "KT18tPu7uXy9PJ97i3qCLsr7an4X6sQ5qxU7",
255
+ moderation_token_v3: "KT1UBWXN1KxTh4eurrCTCH7aEjqdrM3HjP6R",
256
+ moderation_user: "KT1Wn2kkKmdbyLWBiLXWCkE7fKj1LsLKar2A",
257
+ pricing_dutch_auction: "KT1EzLrXRCXij42pKfbZPn48PuxrnVki1aYY",
258
+ pricing_dutch_auction_v3: "KT1MFgHKorMWXeVL6qrpgjZmemirafppSg9q",
259
+ pricing_fixed: "KT1FHzHxuMaNLYG8LdniY45M6RCfkF3AoXFh",
260
+ pricing_fixed_v3: "KT1V24J6FVuKPU3xy6gVF6wJ3zdRXBheQhaV",
261
+ randomizer: "KT1XYgKrzBbzsckGvXTPgxFyN7KNZ9RPYVWf",
262
+ randomizer_v2: "KT1CfmepqJkfZwqLPFVMKFoYUS7dPPZHyCTo",
263
+ token_moderation: "KT1HgVuzNWVvnX16fahbV2LrnpwifYKoFMRd",
264
+ treasury: "KT1P2BXYb894MekrCcSrnidzQYPVqitLoVLc",
265
+ user_moderation: "KT1TWWQ6FtLoosVfZgTKV2q68TMZaENhGm54",
266
+ user_register: "KT1Ezht4PDKZri7aVppVGT4Jkw39sesaFnww",
267
+ onchfs_files: "KT1Ae7dT1gsLw2tRnUMXSCmEyF74KVkM6LUo"
268
+ };
269
+
270
+ //#endregion
271
+ //#region src/contracts/eth.ts
272
+ const ethTestnetContracts = {
273
+ multicall3: "0xcA11bde05977b3631167028862bE2a173976CA11",
274
+ seaport_zone: "0x0000000006B429721d1F4c4cD256BF3A38c09Ac6",
275
+ issuer_factory_v1: "0x4e9ef916F55B5d4a27E6406C7Ce8bcd29c2693d6",
276
+ mint_ticket_factory_v1: "0xbaed21d8C57caf71578b9aE1E09a68721d0Dd02d",
277
+ dutch_auction_minter_v1: "0x2F8ea350E7F29BCaC2AEE5889d64df07EE3Fa98d",
278
+ fixed_price_minter_v1: "0xa6c9c758e80ec18e1a28d485b97400B11dCFCD64",
279
+ ticket_redeemer_v1: "0xdd29eA613e0553fc03f5762Bf643710a7987A216",
280
+ ipfs_renderer_v1: "0x17b9c8a7C6F9D3768D4DA75EBB6abDe9FBe900cf",
281
+ onchfs_renderer_v1: "0x25B087D2c87a0b34188a530dC9cCfDa30822AA8e",
282
+ randomizer_v1: "0x5962e4dEeDe2DB4A83259255D30c19F4397FD5A6",
283
+ role_registry_v1: "0x92B70c5C6E676BdC395DfD911c07392fc7C36E4F",
284
+ contract_registry_v1: "0xb7CFDcDb2c6a1D05D7b85FB4ae7B7bccd028010F",
285
+ gen_art_token_impl_v1: "0x1feeb359e96E6Dd6F19F1FC98e8FffDdf5AeaD58",
286
+ mint_ticket_impl_v1: "0x0303e3a5be6e9Fa21E72cE446a402a6AEec13c60",
287
+ onchfs_file_system: "0x4f555d39e89f6d768f75831d610b3940fa94c6b1",
288
+ onchfs_content_store: "0x070e5A608705aC4954eec054f9074eEe49bDcbfF",
289
+ seaport: "0x00cA04c45da318d5b7E7B14D5381Ca59F09C73f0",
290
+ fxhashTeamSafeAddress: "0x4F073947573FF44621cA25061Fb035c73a3014ab",
291
+ signerSafe: "0x4F073947573FF44621cA25061Fb035c73a3014ab",
292
+ moderationSafe: "0x4F073947573FF44621cA25061Fb035c73a3014ab",
293
+ farcaster_frame_fixed_price_minter_v1: "0xB0905f81167bD90ABD5a583E029D27DA77568084",
294
+ fx_token: "0xfa2e08ebfa6dae5ff68c3a0e2eb33a78f363f9fe"
295
+ };
296
+ /**
297
+ * TODO
298
+ * -----------------------------------------------------------------------------
299
+ * Put the actual addresses.
300
+ */
301
+ const ethMainnetContracts = {
302
+ multicall3: "0xcA11bde05977b3631167028862bE2a173976CA11",
303
+ seaport_zone: "0x0000000006B429721d1F4c4cD256BF3A38c09Ac6",
304
+ issuer_factory_v1: "0x442295de8A31d65026dBc09c29d469F6854f188a",
305
+ mint_ticket_factory_v1: "0xDB92ed0e6265d042F05E5C2f6D2F99496e87D706",
306
+ dutch_auction_minter_v1: "0x1bC736a2b144096a4752534C557D7E6C311CcAF1",
307
+ fixed_price_minter_v1: "0xB645cFfD9bFB93c2c181d5Be0D6a8C1d81C2aEf3",
308
+ ticket_redeemer_v1: "0x3D72011b1bB52e33f9D81Fc5553FF4765e3f32c1",
309
+ ipfs_renderer_v1: "0x48F00F8314920ca0cd763D74acFe8cFE4024a274",
310
+ onchfs_renderer_v1: "0xe9fE6b2e494E40404AcB2b8B0a0Bc7b79FD03c83",
311
+ randomizer_v1: "0xED32Ed47A75e298433cF822E10645C04a0B95075",
312
+ role_registry_v1: "0x22b9Dd17BA1132C027d780bC0A784f08f244022B",
313
+ contract_registry_v1: "0x4DAc308c686D747A804B7E95db606695a529A750",
314
+ gen_art_token_impl_v1: "0x429AC1aA66220573Da6928bcce7384fe50e1284f",
315
+ mint_ticket_impl_v1: "0xc2743B0B901eDAA8ccd1A09914449A797e1079F1",
316
+ onchfs_file_system: "0x9e0f2864c6f125bbf599df6ca6e6c3774c5b2e04",
317
+ onchfs_content_store: "0xC6806fd75745bB5F5B32ADa19963898155f9DB91",
318
+ seaport: "0x00cA04c45da318d5b7E7B14D5381Ca59F09C73f0",
319
+ fxhashTeamSafeAddress: "0xD8b1905022d70e74c6c8aaA2baaf275fBe1634f1",
320
+ signerSafe: "0xB456aF77dEB65065462BD1f0D9098413E6CA4200",
321
+ moderationSafe: "0x99CDaECbe1be4B7232a4f2c79EF76D403886FE1E",
322
+ farcaster_frame_fixed_price_minter_v1: "0x6e625892C739bFD960671Db5544E260757480725",
323
+ fx_token: "0xTODO"
324
+ };
325
+
326
+ //#endregion
327
+ //#region src/api/base.ts
328
+ const baseTestnetApis = {
329
+ rpcs: ["https://sepolia.base.org"],
330
+ reservoir: "https://api-base-sepolia.reservoir.tools",
331
+ safe: "https://safe-transaction-base-sepolia.safe.global/",
332
+ whitelist: "http://localhost:9999/whitelist/new",
333
+ alchemy: { rpc: "https://base-sepolia.g.alchemy.com/v2/xTtlsglqRKcFwSkg2bilqp7U2smOt3g9" }
334
+ };
335
+ const baseMainnetApis = {
336
+ rpcs: ["https://mainnet.base.org"],
337
+ reservoir: "https://api-base.reservoir.tools",
338
+ safe: "https://safe-transaction-base.safe.global/",
339
+ whitelist: "https://api.v2.dev.fxhash-dev.xyz/whitelist/new",
340
+ alchemy: { rpc: "https://base-mainnet.g.alchemy.com/v2/xTtlsglqRKcFwSkg2bilqp7U2smOt3g9" }
341
+ };
342
+
343
+ //#endregion
344
+ //#region src/errors/metadata.ts
345
+ var AppMetadataInvalidTypeError = class extends RichError {
346
+ name = "AppMetadataInvalidTypeError";
347
+ messages = { dev: "App metadata should be an object." };
348
+ };
349
+ var AppMetadataMissingPropertiesError = class extends RichError {
350
+ name = "AppMetadataMissingPropertiesError";
351
+ constructor(par1) {
352
+ super(isRichErrorMessages(par1) ? par1 : { dev: `App metadata is missing required properties ${par1.map((p) => `"${p}"`).join(", ")}` });
353
+ }
354
+ };
355
+
356
+ //#endregion
357
+ //#region src/config/metadata.ts
358
+ const crossEnvMetadata = {
359
+ name: "FXHASH",
360
+ description: "fxhash is a blockchain open platform for Generative Art",
361
+ icon: "https://gateway.fxhash2.xyz/ipfs/QmUQUtCenBEYQLoHvfFCRxyHYDqBE49UGxtcp626FZnFDG"
362
+ };
363
+ /**
364
+ * Get application metadata by merging some cross-env metadata with an
365
+ * environment-specific URL (application front-end).
366
+ */
367
+ function fxAppEnvMetadata(env) {
368
+ return {
369
+ ...crossEnvMetadata,
370
+ url: fxApisByEnv(env).website
371
+ };
372
+ }
373
+ /**
374
+ * Test whether some value is a valid {@link IAppMetadata} interface. If not,
375
+ * the issue causing it to be invalid is returned as a failure.
376
+ * @param value Any value which should be tested for being valid App Metadata
377
+ * @returns A Result with void success or failure with the issue
378
+ */
379
+ function isAppMetadataValid(value) {
380
+ if (!(typeof value === "object")) return failure(new AppMetadataInvalidTypeError());
381
+ const missingProperties = [];
382
+ const requiredProperties = [
383
+ "name",
384
+ "description",
385
+ "url"
386
+ ];
387
+ for (const prop of requiredProperties) if (!value[prop]) missingProperties.push(prop);
388
+ if (missingProperties.length > 0) return failure(new AppMetadataMissingPropertiesError(missingProperties));
389
+ return success();
390
+ }
391
+
392
+ //#endregion
393
+ //#region src/config/algolia.ts
394
+ const algoliaConfig = {
395
+ enabled: true,
396
+ indexGenerativeTokens: "generative-tokens",
397
+ indexOffers: "listings",
398
+ indexUsers: "users",
399
+ indexArticles: "articles",
400
+ indexAccounts: "accounts"
401
+ };
402
+ const algoliaConfigDev = {
403
+ appId: "T4XRS2LFQK",
404
+ ...algoliaConfig
405
+ };
406
+ const algoliaConfigProd = {
407
+ appId: "F7M6D8T095",
408
+ ...algoliaConfig
409
+ };
410
+
411
+ //#endregion
412
+ //#region src/config/gpu.ts
413
+ const GPU_VERSIONS = ["v111", "v132"];
414
+ const gpuRenderingConfigShared = {
415
+ v111: {
416
+ date: "2023-03-06",
417
+ version: "111.0.5563.64"
418
+ },
419
+ v132: {
420
+ date: "2025-01-14",
421
+ version: "132.0.6834.110"
422
+ }
423
+ };
424
+ const createEnvConfig = (batchArns) => {
425
+ return Object.fromEntries(GPU_VERSIONS.map((version) => [version, {
426
+ ...gpuRenderingConfigShared[version],
427
+ batchArn: batchArns[version]
428
+ }]));
429
+ };
430
+ const gpuRenderingConfigDev = createEnvConfig({
431
+ v111: "arn:aws:batch:us-east-1:409089350506:job-definition/fxhash-batch-dev-fxhash-extract-chrome-v111",
432
+ v132: "arn:aws:batch:us-east-1:409089350506:job-definition/fxhash-batch-dev-fxhash-extract-chrome-v132"
433
+ });
434
+ const gpuRenderingConfigProd = createEnvConfig({
435
+ v111: "arn:aws:batch:us-east-1:759392670381:job-definition/fxhash-batch-prd-fxhash-extract-chrome-v111",
436
+ v132: "arn:aws:batch:us-east-1:759392670381:job-definition/fxhash-batch-prd-fxhash-extract-chrome-v132"
437
+ });
438
+
439
+ //#endregion
440
+ //#region src/contracts/base.ts
441
+ const baseTestnetContracts = {
442
+ multicall3: "0xcA11bde05977b3631167028862bE2a173976CA11",
443
+ seaport_zone: "0x0000000006B429721d1F4c4cD256BF3A38c09Ac6",
444
+ issuer_factory_v1: "0x60cFDE3aaf6E938535767794088cf15EaaC50019",
445
+ mint_ticket_factory_v1: "0x8A7e5eE0CeA42DBE1d2aAC4501262B0edC5B518B",
446
+ dutch_auction_minter_v1: "0xeb5Cee0eD6A47BE2A463A0C9e83dA5DE6149d375",
447
+ fixed_price_minter_v1: "0x29159d2DFbF93E991d39Dc080a5f8dcc5C90ebb8",
448
+ ticket_redeemer_v1: "0xFfbC4F51AB33E14380893213d7C969e0626c4C43",
449
+ ipfs_renderer_v1: "0x7657C31078d8bfB8d1BC127fC04dAd23B3f451ed",
450
+ onchfs_renderer_v1: "0xf23C64BA846557c24E6F5086376047b0CE70d1cC",
451
+ randomizer_v1: "0xCA6323f03B5113471BA3b7B2F4Ba0AA2D45aE257",
452
+ role_registry_v1: "0x179f5B8FE1c270D7fC1807355F3fd981A30e21A6",
453
+ contract_registry_v1: "0xd44B3b2Ee596613c1aFcF85c9b0E41A0ec8B79E2",
454
+ gen_art_token_impl_v1: "0x06976f5C039497d8a79Cc0dCE7A95B3E9748164A",
455
+ mint_ticket_impl_v1: "0xa71b5935366BA29332033217a9E83698acadfd2f",
456
+ onchfs_file_system: "0x3fb48e03291b2490f939c961a1ad088437129f71",
457
+ onchfs_content_store: "0x48AC7370df2d5982852172A4D857c29608AFa774",
458
+ seaport: "0x00cA04c45da318d5b7E7B14D5381Ca59F09C73f0",
459
+ fxhashTeamSafeAddress: "0x8a4f6e1ae6Bb77EFE7646f9649Bfd519fA638871",
460
+ signerSafe: "0x8a4f6e1ae6Bb77EFE7646f9649Bfd519fA638871",
461
+ moderationSafe: "0x8a4f6e1ae6Bb77EFE7646f9649Bfd519fA638871",
462
+ farcaster_frame_fixed_price_minter_v1: "0xB0905f81167bD90ABD5a583E029D27DA77568084",
463
+ fx_token: "0xd89fdcB6c8D107f27CEe4452Ccfb70Dc4F9768a7",
464
+ fx_airdrop: "0x1e4e821216582f0771528b848b4a51c8474be2c7",
465
+ fx_tez_airdrop: "0x3c2b4c38d37affb023a1d2327af428909eb8a134",
466
+ fx_token_launchpad: "0x0bfF434B9C7543546EFfa42f654bBbBdD0dCCff8",
467
+ fx_project_factory: "0xD9F9e11D1C2bEa044562Ce9D2590AC032bA87FcF"
468
+ };
469
+ const baseMainnetContracts = {
470
+ multicall3: "0xcA11bde05977b3631167028862bE2a173976CA11",
471
+ seaport_zone: "0x0000000006B429721d1F4c4cD256BF3A38c09Ac6",
472
+ issuer_factory_v1: "0xf05636d65c7a10dF989eC2411D4F3230d3A02f3D",
473
+ mint_ticket_factory_v1: "0xe5832D3a3da179e818e9E3bFF7b96A928b29Eda2",
474
+ dutch_auction_minter_v1: "0x9667a1Cf26223c9de22207DD93cfEEc9237b8f4E",
475
+ fixed_price_minter_v1: "0x4bDcaC532143d8d35ed759189EE22E3704580b9D",
476
+ ticket_redeemer_v1: "0x972502Bc75A780D76495Ffa84Cf8DA301F162Df6",
477
+ ipfs_renderer_v1: "0x9c4cC8403bE33B89a46794Ae409ce634ca567956",
478
+ onchfs_renderer_v1: "0x4180D747e984C9CFEEfaF23944AE0C20c0742341",
479
+ randomizer_v1: "0x6754E97b8eaeC13Fa24480E9d1240176Dd0f2911",
480
+ role_registry_v1: "0x8d3C748e99066e15425BA1620cdD066d85D6d918",
481
+ contract_registry_v1: "0xCa6e30B1C7cBE7cF605cE30B334f968C5E2EA016",
482
+ gen_art_token_impl_v1: "0xC5769428823C9a0393DC66855DD3817b2A85BEFD",
483
+ mint_ticket_impl_v1: "0x3e9754Da0fb002Fa13D69B2f313d5CB441fC8ef5",
484
+ onchfs_file_system: "0x2983008f292a43f208bba0275afd7e9b3d39af3b",
485
+ onchfs_content_store: "0x070e5A608705aC4954eec054f9074eEe49bDcbfF",
486
+ seaport: "0x00cA04c45da318d5b7E7B14D5381Ca59F09C73f0",
487
+ fxhashTeamSafeAddress: "0x38D3a2F9c63D4a580f100B051ba137fa6d8e2560",
488
+ signerSafe: "0x38D3a2F9c63D4a580f100B051ba137fa6d8e2560",
489
+ moderationSafe: "0x38D3a2F9c63D4a580f100B051ba137fa6d8e2560",
490
+ farcaster_frame_fixed_price_minter_v1: "0x6e625892C739bFD960671Db5544E260757480725",
491
+ fx_token: "0x5Fc2843838e65eb0B5d33654628F446d54602791",
492
+ fx_airdrop: "0x45BB9DF166Fda4afD7e533DE42B11579a1F09d43",
493
+ fx_tez_airdrop: "0x5021910a5762F9C872Bf7D6CD5F09127aE8cCA84",
494
+ fx_token_launchpad: "0xTODO",
495
+ fx_project_factory: "0xTODO"
496
+ };
497
+
498
+ //#endregion
499
+ //#region src/types.ts
500
+ /**
501
+ * A mapping of blockchains in their "human-readable" format with their proper
502
+ * blockchain identifier.
503
+ */
504
+ const BlockchainIdentifiers = {
505
+ TezosGhostnet: "tezos:NetXnHfVqm9iesp",
506
+ TezosMainnet: "tezos:NetXdQprcVkpaWU",
507
+ EthereumMainnet: "eip155:1",
508
+ EthereumGoerli: "eip155:5",
509
+ EthereumSepolia: "eip155:11155111",
510
+ BaseSepolia: "eip155:84532",
511
+ BaseMainnet: "eip155:8453"
512
+ };
513
+
514
+ //#endregion
515
+ //#region src/constants.ts
516
+ const AUTH_JWT_PK_DEV = `-----BEGIN PUBLIC KEY-----
517
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1hF8JwAxIiFWzbXIgeOK
518
+ Bzf6SZlT3S1YampzVgy4pw1G0aKwHnyvC+HrRfkEOCGxX24DqbEpZby2LjKF9bfa
519
+ OLrERrNSNrDLXbf3ipKQrnEBu2UdT2pE5UF/SwJUTdGczb78EId0yIjuZ26qZcQg
520
+ Pr1ji6FgdOOdEwdphl4x1dlQzgMgjhRcPwf9NsBx3R6l/ut2o38Qa8azxM7XBg8F
521
+ UlsKGy4/jY2OIEKCravCoXmpeX9pxploED/DoJJI9FZXVB7/91iIb6MI0Ycby+xo
522
+ GL/cF+ZYSVRoFexji4vpycJfltW5YJ8jHSveZWa6LXqM6LY7zRFmlxb3SF4tsDTT
523
+ PQIDAQAB
524
+ -----END PUBLIC KEY-----`;
525
+ const AUTH_JWT_PK_PRD = `-----BEGIN PUBLIC KEY-----
526
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtwl1CRvpN7MZeGGDTy8x
527
+ +W3EkZfBzZqEp3vahCaqBdMkMhy7oB1pUU7pjb34tg9epnKdKo0cZn+Bw1LkSKWh
528
+ Z1DSbgCdNR47qKb4xN8mZ5VvEw/64+nUXbCOikX+rMqSE2tNeNU3KOYr8VQYt9dv
529
+ /J0xFwsr0aa4m23dmJ/oPLA8eR8lZk++fEZsbezKH3i9zz73I0UAivijM0S9lYeB
530
+ NkT5zOaAJARzl69hEMQAv9qUkokwPSHlcG+LakhTGYAyMe3w/KHXVRkWjuCUgUJf
531
+ 90oveckX4dhMbHbz9ba1p3hpmwdmlRzljIIE2GQYawA8eNLsOb/z6V8HGMbCL/N9
532
+ JwIDAQAB
533
+ -----END PUBLIC KEY-----`;
534
+
535
+ //#endregion
536
+ //#region src/config.ts
537
+ /**
538
+ * ! Beware ! Changing these values will result in current
539
+ * projects breaking.
540
+ * https://github.com/fxhash/monorepo/issues/701
541
+ */
542
+ const tezosFees = {
543
+ primary: 500,
544
+ secondary: 250
545
+ };
546
+ const ethFees = {
547
+ primary: 1e3,
548
+ secondary: 2500
549
+ };
550
+ const baseFees = {
551
+ primary: 1e3,
552
+ secondary: 2500
553
+ };
554
+ /**
555
+ * --------------------------------------------------------
556
+ */
557
+ const fxhashConfig = {
558
+ networks: {
559
+ testnet: {
560
+ tez: {
561
+ contracts: tezosTestnetContracts,
562
+ config: {
563
+ network: "ghostnet",
564
+ chainId: BlockchainIdentifiers.TezosGhostnet,
565
+ ethFeeReceiver: "0x",
566
+ wertRelayer: "tz1T2uyYTshSGrEg13VGJFqsWwbi2H175hZb",
567
+ fxhashFees: tezosFees,
568
+ royaltyBasisPoint: 1e3,
569
+ splitBasisPoint: 1e3
570
+ },
571
+ apis: tezosTestnetApis
572
+ },
573
+ eth: {
574
+ contracts: ethTestnetContracts,
575
+ config: {
576
+ network: "Sepolia",
577
+ chainId: BlockchainIdentifiers.EthereumSepolia,
578
+ ethFeeReceiver: "0xe1f04609f7bC45e23a1BA4CD4a76f476755beBA6",
579
+ wertRelayer: "0x2ff0ec69341f43cc462251bd49bb63681adafcb0",
580
+ fxhashFees: ethFees,
581
+ royaltyBasisPoint: 1e4,
582
+ splitBasisPoint: 1e6
583
+ },
584
+ apis: ethTestnetApis
585
+ },
586
+ base: {
587
+ contracts: baseTestnetContracts,
588
+ config: {
589
+ network: "Base Sepolia",
590
+ chainId: BlockchainIdentifiers.BaseSepolia,
591
+ ethFeeReceiver: "0xF70DF285Bc6941b4760BcC041B0cA1cc50E27F8d",
592
+ wertRelayer: "0x2ff0ec69341f43cc462251bd49bb63681adafcb0",
593
+ fxhashFees: baseFees,
594
+ royaltyBasisPoint: 1e4,
595
+ splitBasisPoint: 1e6
596
+ },
597
+ apis: baseTestnetApis
598
+ }
599
+ },
600
+ mainnet: {
601
+ tez: {
602
+ contracts: tezosMainnetContracts,
603
+ config: {
604
+ network: "mainnet",
605
+ chainId: BlockchainIdentifiers.TezosMainnet,
606
+ ethFeeReceiver: "0x",
607
+ wertRelayer: "tz1KkPS1TWFyDWfQwrdvmTmsCLUNMegDrrSi",
608
+ fxhashFees: tezosFees,
609
+ royaltyBasisPoint: 1e3,
610
+ splitBasisPoint: 1e3
611
+ },
612
+ apis: tezosMainnetApis
613
+ },
614
+ eth: {
615
+ contracts: ethMainnetContracts,
616
+ config: {
617
+ network: "Ethereum",
618
+ chainId: BlockchainIdentifiers.EthereumMainnet,
619
+ ethFeeReceiver: "0xed650E40F7bd3812152D4BFA6740662F50e178DF",
620
+ wertRelayer: "0xc16157e00b1bff1522c6f01246b4fb621da048d0",
621
+ fxhashFees: ethFees,
622
+ royaltyBasisPoint: 1e4,
623
+ splitBasisPoint: 1e6
624
+ },
625
+ apis: ethMainnetApis
626
+ },
627
+ base: {
628
+ contracts: baseMainnetContracts,
629
+ config: {
630
+ network: "Base",
631
+ chainId: BlockchainIdentifiers.BaseMainnet,
632
+ ethFeeReceiver: "0xF70DF285Bc6941b4760BcC041B0cA1cc50E27F8d",
633
+ wertRelayer: "0xc16157e00b1bff1522c6f01246b4fb621da048d0",
634
+ fxhashFees: baseFees,
635
+ royaltyBasisPoint: 1e4,
636
+ splitBasisPoint: 1e6
637
+ },
638
+ apis: baseMainnetApis
639
+ }
640
+ }
641
+ },
642
+ envs: {
643
+ local: {
644
+ apis: fxhashLocalApis,
645
+ config: {
646
+ envName: "local",
647
+ metadata: fxAppEnvMetadata("local"),
648
+ gtMinPrice: "0",
649
+ walletConnectId: "111994543d1b754bab82c368d0e61ae5",
650
+ projectLockTime: 3600,
651
+ referrerShare: 0,
652
+ splitsApiKey: "75348d57d6cf60fa4551766c",
653
+ cloudflareTurnstileSiteKey: "1x00000000000000000000AA",
654
+ cloudflareTurnstileSiteKeyV2: "0x4AAAAAAAW-w_xThcj91jkA",
655
+ syndicateProjectId: "9dd71e90-4605-45f4-94e0-4e533b01081d",
656
+ awsS3Bucket: "fxh-media-assets-dev-testnet-us-east-1",
657
+ awsS3Region: "us-east-1",
658
+ openTelemetryTarget: "http://localhost:14268",
659
+ algolia: algoliaConfigDev,
660
+ gpu: gpuRenderingConfigDev,
661
+ authJwtPublicKey: AUTH_JWT_PK_DEV
662
+ }
663
+ },
664
+ localDocker: {
665
+ apis: fxhashLocalDockerApis,
666
+ config: {
667
+ envName: "localDocker",
668
+ metadata: fxAppEnvMetadata("localDocker"),
669
+ gtMinPrice: "0",
670
+ walletConnectId: "111994543d1b754bab82c368d0e61ae5",
671
+ projectLockTime: 3600,
672
+ referrerShare: 0,
673
+ splitsApiKey: "75348d57d6cf60fa4551766c",
674
+ cloudflareTurnstileSiteKey: "1x00000000000000000000AA",
675
+ cloudflareTurnstileSiteKeyV2: "0x4AAAAAAAW-w_xThcj91jkA",
676
+ syndicateProjectId: "9dd71e90-4605-45f4-94e0-4e533b01081d",
677
+ awsS3Bucket: "fxh-media-assets-dev-testnet-us-east-1",
678
+ awsS3Region: "us-east-1",
679
+ openTelemetryTarget: "http://localhost:14268",
680
+ algolia: algoliaConfigDev,
681
+ gpu: gpuRenderingConfigDev,
682
+ authJwtPublicKey: AUTH_JWT_PK_DEV
683
+ }
684
+ },
685
+ dev: {
686
+ apis: fxhashDevApis,
687
+ config: {
688
+ envName: "development",
689
+ metadata: fxAppEnvMetadata("dev"),
690
+ gtMinPrice: "0",
691
+ walletConnectId: "111994543d1b754bab82c368d0e61ae5",
692
+ projectLockTime: 3600,
693
+ referrerShare: 0,
694
+ splitsApiKey: "75348d57d6cf60fa4551766c",
695
+ cloudflareTurnstileSiteKey: "0x4AAAAAAAVOb6invoeYS4EN",
696
+ cloudflareTurnstileSiteKeyV2: "0x4AAAAAAAW-w_xThcj91jkA",
697
+ syndicateProjectId: "9dd71e90-4605-45f4-94e0-4e533b01081d",
698
+ awsS3Bucket: "fxh-media-assets-dev-testnet-us-east-1",
699
+ awsS3Region: "us-east-1",
700
+ openTelemetryTarget: "https://tempo.ss.fxhash2.xyz",
701
+ algolia: algoliaConfigDev,
702
+ gpu: gpuRenderingConfigDev,
703
+ authJwtPublicKey: AUTH_JWT_PK_DEV
704
+ }
705
+ },
706
+ prd: {
707
+ apis: fxhashPrdApis,
708
+ config: {
709
+ envName: "production",
710
+ metadata: fxAppEnvMetadata("prd"),
711
+ gtMinPrice: "0",
712
+ walletConnectId: "111994543d1b754bab82c368d0e61ae5",
713
+ projectLockTime: 3600,
714
+ referrerShare: 0,
715
+ splitsApiKey: "75348d57d6cf60fa4551766c",
716
+ cloudflareTurnstileSiteKey: "0x4AAAAAAAVObp1YeuhbqNKB",
717
+ cloudflareTurnstileSiteKeyV2: "0x4AAAAAAAW-yE4Q6Wdz6SNb",
718
+ syndicateProjectId: "398ad73d-341c-4861-a038-f0ae1ca58e07",
719
+ awsS3Bucket: "fxh-media-assets-prd-mainnet-us-east-1",
720
+ awsS3Region: "us-east-1",
721
+ openTelemetryTarget: "https://tempo.ss.fxhash2.xyz",
722
+ algolia: algoliaConfigProd,
723
+ gpu: gpuRenderingConfigProd,
724
+ authJwtPublicKey: AUTH_JWT_PK_PRD
725
+ }
726
+ }
727
+ }
728
+ };
729
+ function getBlockchainNetworkForEnv(env) {
730
+ return env === "prd" ? "mainnet" : "testnet";
731
+ }
732
+ function getConfigForEnv(env) {
733
+ const blockchainNetwork = getBlockchainNetworkForEnv(env);
734
+ return {
735
+ ...fxhashConfig.networks[blockchainNetwork],
736
+ ...fxhashConfig.envs[env]
737
+ };
738
+ }
739
+ const localConfig = getConfigForEnv("local");
740
+ const localDockerConfig = getConfigForEnv("localDocker");
741
+ const devConfig = getConfigForEnv("dev");
742
+ const prdConfig = getConfigForEnv("prd");
743
+ const currentEnv = getEnv();
744
+ let config = getConfigForEnv(currentEnv);
37
745
  function setConfig(userConfig) {
38
- config = {
39
- ...config,
40
- ...userConfig
41
- };
42
- return config;
746
+ config = {
747
+ ...config,
748
+ ...userConfig
749
+ };
750
+ return config;
43
751
  }
44
- var src_default = fxhashConfig;
45
- export {
46
- BlockchainIdentifiers,
47
- config,
48
- src_default as default,
49
- devConfig,
50
- ethTestnetApis,
51
- ethTestnetContracts,
52
- fxhashConfig,
53
- fxhashDevApis,
54
- fxhashPrdApis,
55
- prdConfig,
56
- setConfig,
57
- tezosMainnetApis,
58
- tezosMainnetContracts,
59
- tezosTestnetApis,
60
- tezosTestnetContracts
752
+
753
+ //#endregion
754
+ //#region src/utils/ipfs.ts
755
+ let EGatewayIpfs = /* @__PURE__ */ function(EGatewayIpfs$1) {
756
+ EGatewayIpfs$1["FXHASH"] = "FXHASH";
757
+ EGatewayIpfs$1["FXHASH_SAFE"] = "FXHASH_SAFE";
758
+ EGatewayIpfs$1["IPFSIO"] = "IPFSIO";
759
+ return EGatewayIpfs$1;
760
+ }({});
761
+ const ipfsRegex = new RegExp("^ipfs://");
762
+ /**
763
+ * Given a gateway enum, outputs the http url root of the gateway
764
+ */
765
+ function ipfsGatewayRoot(gateway) {
766
+ switch (gateway) {
767
+ case EGatewayIpfs.FXHASH: return config.apis.ipfsGateway;
768
+ case EGatewayIpfs.FXHASH_SAFE: return config.apis.ipfsGatewaySafe;
769
+ case EGatewayIpfs.IPFSIO:
770
+ default: return "https://ipfs.io";
771
+ }
772
+ }
773
+ /**
774
+ * Returns the CID or a resource, whether it's already a CID or an ipfs://<CID> resource
775
+ * @param resource either a CID or a ipfs://<CID> string
776
+ */
777
+ function ipfsCidFromUriOrCid(resource) {
778
+ if (!ipfsRegex.test(resource)) return resource;
779
+ return resource.slice(7);
780
+ }
781
+ /**
782
+ * Given a CID or ipfs://<CID>, returns an URL to a gateway pointing to the resource
783
+ * @param resource the resource input, either a CID or ipfs://<CID>
784
+ * @param gateway the gateway URL to use for the resource
785
+ */
786
+ function ipfsGatewayUrl(resource, gateway = EGatewayIpfs.FXHASH_SAFE) {
787
+ if (!resource) return "";
788
+ const cid = ipfsCidFromUriOrCid(resource);
789
+ return `${ipfsGatewayRoot(gateway)}/ipfs/${cid}`;
790
+ }
791
+ /**
792
+ * given a URI (either ipfs://<CID>, onchfs://<CID> or temp://<CID>),
793
+ * returns the URL to the resource
794
+ */
795
+ function proxyUrl(uri) {
796
+ if (uri.startsWith("blob:") || uri.startsWith("data:")) return uri;
797
+ const [protocol, cid] = uri.split("://");
798
+ switch (protocol) {
799
+ case "https": return uri;
800
+ case "temp": return `${config.apis.fsEmulator}/resolve/${cid}`;
801
+ case "onchfs": return `${config.apis.onchfsProxy}/${cid}`;
802
+ default: return ipfsGatewayUrl(uri);
803
+ }
804
+ }
805
+
806
+ //#endregion
807
+ //#region src/utils/contracts.ts
808
+ const tezosContractPrefixesByContractAddress = {
809
+ [config.tez.contracts.gentk_v1]: "FX0",
810
+ [config.tez.contracts.gentk_v2]: "FX0",
811
+ [config.tez.contracts.gentk_v3]: "FX1"
61
812
  };
813
+ function getObjktIdFromContract(contract, id) {
814
+ return `${tezosContractPrefixesByContractAddress[contract]}-${id}`;
815
+ }
816
+
817
+ //#endregion
818
+ //#region src/index.ts
819
+ var src_default = fxhashConfig;
820
+
821
+ //#endregion
822
+ export { BlockchainIdentifiers, EGatewayIpfs, config, src_default as default, devConfig, ethTestnetApis, ethTestnetContracts, fxhashConfig, fxhashDevApis, fxhashPrdApis, getDockerInternalUrl, getEnv, getObjktIdFromContract, ipfsCidFromUriOrCid, ipfsGatewayRoot, ipfsGatewayUrl, isAppMetadataValid, isDockerLocal, isLocal, isProd, localConfig, prdConfig, proxyUrl, setConfig, tezosContractPrefixesByContractAddress, tezosMainnetApis, tezosMainnetContracts, tezosTestnetApis, tezosTestnetContracts };
62
823
  //# sourceMappingURL=index.js.map