@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.
- package/README.md +18 -2
- package/dist/index.d.ts +410 -10
- package/dist/index.js +817 -56
- package/dist/index.js.map +1 -1
- package/package.json +19 -20
- package/dist/api/eth.cjs +0 -9
- package/dist/api/eth.cjs.map +0 -1
- package/dist/api/eth.d.ts +0 -10
- package/dist/api/eth.js +0 -9
- package/dist/api/eth.js.map +0 -1
- package/dist/api/fxhash.cjs +0 -11
- package/dist/api/fxhash.cjs.map +0 -1
- package/dist/api/fxhash.d.ts +0 -37
- package/dist/api/fxhash.js +0 -11
- package/dist/api/fxhash.js.map +0 -1
- package/dist/api/tezos.cjs +0 -9
- package/dist/api/tezos.cjs.map +0 -1
- package/dist/api/tezos.d.ts +0 -9
- package/dist/api/tezos.js +0 -9
- package/dist/api/tezos.js.map +0 -1
- package/dist/chunk-2Z36EJVM.cjs +0 -159
- package/dist/chunk-2Z36EJVM.cjs.map +0 -1
- package/dist/chunk-3HYMO7HS.js +0 -13
- package/dist/chunk-3HYMO7HS.js.map +0 -1
- package/dist/chunk-3U7S5KQ5.js +0 -45
- package/dist/chunk-3U7S5KQ5.js.map +0 -1
- package/dist/chunk-6LCEWPDB.js +0 -80
- package/dist/chunk-6LCEWPDB.js.map +0 -1
- package/dist/chunk-7WY5VFHS.js +0 -27
- package/dist/chunk-7WY5VFHS.js.map +0 -1
- package/dist/chunk-BDNQHSCV.cjs +0 -13
- package/dist/chunk-BDNQHSCV.cjs.map +0 -1
- package/dist/chunk-HFJTQFU5.cjs +0 -80
- package/dist/chunk-HFJTQFU5.cjs.map +0 -1
- package/dist/chunk-LYBPFYQE.cjs +0 -81
- package/dist/chunk-LYBPFYQE.cjs.map +0 -1
- package/dist/chunk-M7HZ3LKE.js +0 -19
- package/dist/chunk-M7HZ3LKE.js.map +0 -1
- package/dist/chunk-NSIM63EC.cjs +0 -27
- package/dist/chunk-NSIM63EC.cjs.map +0 -1
- package/dist/chunk-OX246A4J.js +0 -81
- package/dist/chunk-OX246A4J.js.map +0 -1
- package/dist/chunk-VOYFMWZ7.js +0 -159
- package/dist/chunk-VOYFMWZ7.js.map +0 -1
- package/dist/chunk-VUNWHN5H.cjs +0 -19
- package/dist/chunk-VUNWHN5H.cjs.map +0 -1
- package/dist/chunk-XQC264QN.cjs +0 -45
- package/dist/chunk-XQC264QN.cjs.map +0 -1
- package/dist/config.cjs +0 -19
- package/dist/config.cjs.map +0 -1
- package/dist/config.d.ts +0 -79
- package/dist/config.js +0 -19
- package/dist/config.js.map +0 -1
- package/dist/contracts/eth.cjs +0 -9
- package/dist/contracts/eth.cjs.map +0 -1
- package/dist/contracts/eth.d.ts +0 -28
- package/dist/contracts/eth.js +0 -9
- package/dist/contracts/eth.js.map +0 -1
- package/dist/contracts/tezos.cjs +0 -9
- package/dist/contracts/tezos.cjs.map +0 -1
- package/dist/contracts/tezos.d.ts +0 -41
- package/dist/contracts/tezos.js +0 -9
- package/dist/contracts/tezos.js.map +0 -1
- package/dist/index.cjs +0 -62
- package/dist/index.cjs.map +0 -1
- package/dist/types.cjs +0 -7
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.ts +0 -19
- package/dist/types.js +0 -7
- package/dist/types.js.map +0 -1
- package/dist/utils/index.cjs +0 -15
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.js +0 -15
- package/dist/utils/index.js.map +0 -1
package/README.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
-
# fxhash
|
1
|
+
# @fxhash/config
|
2
2
|
|
3
|
-
|
3
|
+
This contains all variables used within all modules of fx(package)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```
|
8
|
+
pnpm add @fxhash/config
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
4
12
|
|
5
13
|
For you application you usually want to use the config like this:
|
6
14
|
|
@@ -12,3 +20,11 @@ This singleton will expose variables for testnet/mainnet based on the `FXHASH_EN
|
|
12
20
|
|
13
21
|
- Set `FXHASH_ENV=dev` to expose the config for testnet/dev environments
|
14
22
|
- Set `FXHASH_ENV=prd` or `FXHASH_ENV=production` to expose the config for mainnet/production environments
|
23
|
+
|
24
|
+
> Note: If the `@fxhash/config` package is used on the client side you also have to set the `NEXT_PUBLIC_FXHASH_ENV` or `REACT_APP_FXHASH_ENV` environment variable.
|
25
|
+
|
26
|
+
### Local development
|
27
|
+
|
28
|
+
Additional to the testnet and mainnet specific configuration there is the 3rd option for `local` development. This option is designed to be used within the fxhash monorepository. You can use it by setting the `FXHASH_ENV=local` environment variable. Since all services are dockerised there is an additional `localDocker` configuration. This configuration is automatically used when the `@fxhash/config` package is used inside a docker container and the `FXHASH_ENV` is set to `local`. The `localDocker` configuration basically just replaces all "localhost" urls with "host.docker.internal".
|
29
|
+
|
30
|
+
- Set `FXHASH_ENV=local` to expose the config for local development within the fxhash monorepository
|
package/dist/index.d.ts
CHANGED
@@ -1,13 +1,413 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export { IFxhashApis, fxhashDevApis, fxhashPrdApis } from './api/fxhash.js';
|
4
|
-
export { ITezosContracts, tezosMainnetContracts, tezosTestnetContracts } from './contracts/tezos.js';
|
5
|
-
export { IEthContracts, ethTestnetContracts } from './contracts/eth.js';
|
6
|
-
import { fxhashConfig, IFxhashConfigSingleEnv } from './config.js';
|
7
|
-
export { IFxhashConfig, IFxhashEnvConfig, IFxhashNetworkConfig, TBlockchain, TBlockchainNetwork, TEnv, devConfig, prdConfig } from './config.js';
|
8
|
-
export { BlockchainIdentifier, BlockchainIdentifiers } from './types.js';
|
1
|
+
import { Result } from "@fxhash/utils";
|
2
|
+
import { IRichErrorMessages, RichError, RichErrorUnion } from "@fxhash/errors";
|
9
3
|
|
4
|
+
//#region src/api/eth.d.ts
|
5
|
+
interface IEthApis {
|
6
|
+
rpcs: string[];
|
7
|
+
reservoir: string;
|
8
|
+
safe: string;
|
9
|
+
whitelist: string;
|
10
|
+
alchemy: {
|
11
|
+
rpc: string;
|
12
|
+
};
|
13
|
+
}
|
14
|
+
declare const ethTestnetApis: IEthApis;
|
15
|
+
//#endregion
|
16
|
+
//#region src/api/tezos.d.ts
|
17
|
+
interface ITezosApis {
|
18
|
+
tzktWebsite: string;
|
19
|
+
tzkt: string;
|
20
|
+
tzktPro: string;
|
21
|
+
rpcs: string[];
|
22
|
+
}
|
23
|
+
declare const tezosTestnetApis: ITezosApis;
|
24
|
+
declare const tezosMainnetApis: ITezosApis;
|
25
|
+
//#endregion
|
26
|
+
//#region src/api/base.d.ts
|
27
|
+
interface IBaseApis {
|
28
|
+
rpcs: string[];
|
29
|
+
reservoir: string;
|
30
|
+
safe: string;
|
31
|
+
whitelist: string;
|
32
|
+
alchemy: {
|
33
|
+
rpc: string;
|
34
|
+
};
|
35
|
+
}
|
36
|
+
//#endregion
|
37
|
+
//#region src/config/algolia.d.ts
|
38
|
+
type AlgoliaConfig = {
|
39
|
+
appId: string;
|
40
|
+
enabled: boolean;
|
41
|
+
indexGenerativeTokens: string;
|
42
|
+
indexOffers: string;
|
43
|
+
indexUsers: string;
|
44
|
+
indexArticles: string;
|
45
|
+
indexAccounts: string;
|
46
|
+
};
|
47
|
+
//#endregion
|
48
|
+
//#region src/config/gpu.d.ts
|
49
|
+
declare const GPU_VERSIONS: readonly ["v111", "v132"];
|
50
|
+
type GPUVersion = (typeof GPU_VERSIONS)[number];
|
51
|
+
interface GPURenderingVersionConfig {
|
52
|
+
date: string;
|
53
|
+
version: string;
|
54
|
+
batchArn: string;
|
55
|
+
}
|
56
|
+
type GPURenderingConfig = Record<GPUVersion, GPURenderingVersionConfig>;
|
57
|
+
// Environment configs
|
58
|
+
//#endregion
|
59
|
+
//#region src/contracts/base.d.ts
|
60
|
+
interface IBaseContracts {
|
61
|
+
multicall3: `0x${string}`;
|
62
|
+
seaport_zone: `0x${string}`;
|
63
|
+
issuer_factory_v1: `0x${string}`;
|
64
|
+
fixed_price_minter_v1: `0x${string}`;
|
65
|
+
dutch_auction_minter_v1: `0x${string}`;
|
66
|
+
mint_ticket_factory_v1: `0x${string}`;
|
67
|
+
ticket_redeemer_v1: `0x${string}`;
|
68
|
+
ipfs_renderer_v1: `0x${string}`;
|
69
|
+
onchfs_renderer_v1: `0x${string}`;
|
70
|
+
randomizer_v1: `0x${string}`;
|
71
|
+
role_registry_v1: `0x${string}`;
|
72
|
+
contract_registry_v1: `0x${string}`;
|
73
|
+
gen_art_token_impl_v1: `0x${string}`;
|
74
|
+
mint_ticket_impl_v1: `0x${string}`;
|
75
|
+
onchfs_file_system: `0x${string}`;
|
76
|
+
onchfs_content_store: `0x${string}`;
|
77
|
+
seaport: `0x${string}`;
|
78
|
+
fxhashTeamSafeAddress: `0x${string}`;
|
79
|
+
signerSafe: `0x${string}`;
|
80
|
+
moderationSafe: `0x${string}`;
|
81
|
+
farcaster_frame_fixed_price_minter_v1: `0x${string}`;
|
82
|
+
fx_token: `0x${string}`;
|
83
|
+
fx_airdrop: `0x${string}`;
|
84
|
+
fx_tez_airdrop: `0x${string}`;
|
85
|
+
fx_token_launchpad: `0x${string}`;
|
86
|
+
fx_project_factory: `0x${string}`;
|
87
|
+
}
|
88
|
+
//#endregion
|
89
|
+
//#region src/contracts/eth.d.ts
|
90
|
+
interface IEthContracts {
|
91
|
+
multicall3: `0x${string}`;
|
92
|
+
seaport_zone: `0x${string}`;
|
93
|
+
issuer_factory_v1: `0x${string}`;
|
94
|
+
fixed_price_minter_v1: `0x${string}`;
|
95
|
+
dutch_auction_minter_v1: `0x${string}`;
|
96
|
+
mint_ticket_factory_v1: `0x${string}`;
|
97
|
+
ticket_redeemer_v1: `0x${string}`;
|
98
|
+
ipfs_renderer_v1: `0x${string}`;
|
99
|
+
onchfs_renderer_v1: `0x${string}`;
|
100
|
+
randomizer_v1: `0x${string}`;
|
101
|
+
role_registry_v1: `0x${string}`;
|
102
|
+
contract_registry_v1: `0x${string}`;
|
103
|
+
gen_art_token_impl_v1: `0x${string}`;
|
104
|
+
mint_ticket_impl_v1: `0x${string}`;
|
105
|
+
onchfs_file_system: `0x${string}`;
|
106
|
+
onchfs_content_store: `0x${string}`;
|
107
|
+
seaport: `0x${string}`;
|
108
|
+
fxhashTeamSafeAddress: `0x${string}`;
|
109
|
+
signerSafe: `0x${string}`;
|
110
|
+
moderationSafe: `0x${string}`;
|
111
|
+
farcaster_frame_fixed_price_minter_v1: `0x${string}`;
|
112
|
+
fx_token: `0x${string}`;
|
113
|
+
}
|
114
|
+
declare const ethTestnetContracts: IEthContracts;
|
115
|
+
/**
|
116
|
+
* TODO
|
117
|
+
* -----------------------------------------------------------------------------
|
118
|
+
* Put the actual addresses.
|
119
|
+
*/
|
120
|
+
//#endregion
|
121
|
+
//#region src/contracts/tezos.d.ts
|
122
|
+
interface ITezosContracts {
|
123
|
+
allowed_mint: string;
|
124
|
+
allowed_mint_issuer: string;
|
125
|
+
allowed_mint_issuer_v3: string;
|
126
|
+
allowed_mint_v3: string;
|
127
|
+
articles: string;
|
128
|
+
card_proxy: string;
|
129
|
+
collaboration_factory: string;
|
130
|
+
consumable_database: string;
|
131
|
+
cycles: string;
|
132
|
+
gentk_v1: string;
|
133
|
+
gentk_v1_data: string;
|
134
|
+
gentk_v2: string;
|
135
|
+
gentk_v3: string;
|
136
|
+
issuer_tickets: string;
|
137
|
+
issuer_v0: string;
|
138
|
+
issuer_v1: string;
|
139
|
+
issuer_v2: string;
|
140
|
+
issuer_v3: string;
|
141
|
+
marketplace_v1: string;
|
142
|
+
marketplace_v2: string;
|
143
|
+
marketplace_v3: string;
|
144
|
+
moderation_articles: string;
|
145
|
+
moderation_team: string;
|
146
|
+
moderation_token: string;
|
147
|
+
moderation_token_v3: string;
|
148
|
+
moderation_user: string;
|
149
|
+
pricing_dutch_auction: string;
|
150
|
+
pricing_dutch_auction_v3: string;
|
151
|
+
pricing_fixed: string;
|
152
|
+
pricing_fixed_v3: string;
|
153
|
+
randomizer: string;
|
154
|
+
randomizer_v2: string;
|
155
|
+
token_moderation: string;
|
156
|
+
treasury: string;
|
157
|
+
user_moderation: string;
|
158
|
+
user_register: string;
|
159
|
+
onchfs_files: string;
|
160
|
+
}
|
161
|
+
// The Tezos Smart Contracts addresses on testnet
|
162
|
+
declare const tezosTestnetContracts: ITezosContracts;
|
163
|
+
// The Tezos Smart Contracts on mainnet
|
164
|
+
declare const tezosMainnetContracts: ITezosContracts;
|
165
|
+
//#endregion
|
166
|
+
//#region src/types.d.ts
|
167
|
+
interface IFxhashApis {
|
168
|
+
website: string;
|
169
|
+
docs: string;
|
170
|
+
main: string;
|
171
|
+
hasura: string;
|
172
|
+
hasuraGql: string;
|
173
|
+
file: string;
|
174
|
+
fileInternal: string;
|
175
|
+
walletInternal: string;
|
176
|
+
fsEmulator: string;
|
177
|
+
extract: string;
|
178
|
+
extractInternal: string;
|
179
|
+
media: string;
|
180
|
+
ethMetadata: string;
|
181
|
+
ipfsInternal: string;
|
182
|
+
ipfsGateway: string;
|
183
|
+
ipfsGatewaySafe: string;
|
184
|
+
ipfsGatewayInternal: string;
|
185
|
+
onchfsProxy: string;
|
186
|
+
opensea: string;
|
187
|
+
authority: {
|
188
|
+
api: string;
|
189
|
+
};
|
190
|
+
capture: {
|
191
|
+
lambdas: {
|
192
|
+
small: string;
|
193
|
+
medium: string;
|
194
|
+
large: string;
|
195
|
+
};
|
196
|
+
proxy: {
|
197
|
+
ipfs: string;
|
198
|
+
onchfs: string;
|
199
|
+
};
|
200
|
+
};
|
201
|
+
events: {
|
202
|
+
liveBackend: string;
|
203
|
+
};
|
204
|
+
indexer: {
|
205
|
+
tez: string;
|
206
|
+
eth: string;
|
207
|
+
base: string;
|
208
|
+
};
|
209
|
+
}
|
210
|
+
/**
|
211
|
+
* A mapping of blockchains in their "human-readable" format with their proper
|
212
|
+
* blockchain identifier.
|
213
|
+
*/
|
214
|
+
declare const BlockchainIdentifiers: {
|
215
|
+
readonly TezosGhostnet: "tezos:NetXnHfVqm9iesp";
|
216
|
+
readonly TezosMainnet: "tezos:NetXdQprcVkpaWU";
|
217
|
+
readonly EthereumMainnet: "eip155:1";
|
218
|
+
readonly EthereumGoerli: "eip155:5";
|
219
|
+
readonly EthereumSepolia: "eip155:11155111";
|
220
|
+
readonly BaseSepolia: "eip155:84532";
|
221
|
+
readonly BaseMainnet: "eip155:8453";
|
222
|
+
};
|
223
|
+
/**
|
224
|
+
* An union of all the blockchains supported by fxhash, defined by their chain
|
225
|
+
* identifier. Can be used to facilitate typescript auto-completion with string
|
226
|
+
* when enums aren't as good.
|
227
|
+
*/
|
228
|
+
type BlockchainIdentifier = (typeof BlockchainIdentifiers)[keyof typeof BlockchainIdentifiers];
|
229
|
+
// the variations supported by the config
|
230
|
+
type TBlockchain = "tez" | "eth" | "base";
|
231
|
+
type TBlockchainNetwork = "testnet" | "mainnet";
|
232
|
+
type TEnv = "dev" | "prd" | "local" | "localDocker";
|
233
|
+
type TEnvName = "development" | "production" | "local" | "localDocker";
|
234
|
+
interface IFxhashNetworkConfig {
|
235
|
+
network: string;
|
236
|
+
chainId: BlockchainIdentifier;
|
237
|
+
ethFeeReceiver: `0x${string}`;
|
238
|
+
wertRelayer: string;
|
239
|
+
fxhashFees: {
|
240
|
+
primary: number;
|
241
|
+
secondary: number;
|
242
|
+
};
|
243
|
+
royaltyBasisPoint: number;
|
244
|
+
splitBasisPoint: number;
|
245
|
+
}
|
246
|
+
/**
|
247
|
+
* Meta info about the application. Can be used by wallets to scope the
|
248
|
+
* application making requests for instance.
|
249
|
+
*/
|
250
|
+
interface IAppMetadata {
|
251
|
+
/**
|
252
|
+
* Application name. Will be displayed by wallets when a request is made
|
253
|
+
* (signing a message, sending a transaction)
|
254
|
+
*/
|
255
|
+
name: string;
|
256
|
+
/**
|
257
|
+
* A short sentence (<25 words) describing the app. Might be used by wallets
|
258
|
+
* to display extra info about your app.
|
259
|
+
*/
|
260
|
+
description: string;
|
261
|
+
/**
|
262
|
+
* **IMPORTANT**: This should match the URL in which the JS context making
|
263
|
+
* requests to wallets will be executed. **If doesn't match execution
|
264
|
+
* context domain, wallets may display a red warning.
|
265
|
+
*/
|
266
|
+
url: string;
|
267
|
+
/**
|
268
|
+
* URL to your application icon. Recommended: PNG 256x256
|
269
|
+
* May be used by wallet apps in their UI when users interact with your app.
|
270
|
+
*/
|
271
|
+
icon?: string;
|
272
|
+
}
|
273
|
+
interface IFxhashEnvConfig {
|
274
|
+
envName: TEnvName;
|
275
|
+
metadata: IAppMetadata;
|
276
|
+
gtMinPrice: string;
|
277
|
+
walletConnectId: string;
|
278
|
+
splitsApiKey: string;
|
279
|
+
projectLockTime: number;
|
280
|
+
referrerShare: number;
|
281
|
+
cloudflareTurnstileSiteKey: string;
|
282
|
+
cloudflareTurnstileSiteKeyV2: string;
|
283
|
+
syndicateProjectId: string;
|
284
|
+
awsS3Bucket: string;
|
285
|
+
awsS3Region: string;
|
286
|
+
openTelemetryTarget: string;
|
287
|
+
algolia: AlgoliaConfig;
|
288
|
+
gpu: GPURenderingConfig;
|
289
|
+
authJwtPublicKey: string;
|
290
|
+
}
|
291
|
+
type TBlockchainContacts = { [B in TBlockchain]: {
|
292
|
+
tez: ITezosContracts;
|
293
|
+
eth: IEthContracts;
|
294
|
+
base: IBaseContracts;
|
295
|
+
}[B] };
|
296
|
+
type TBlockchainApis = { [B in TBlockchain]: {
|
297
|
+
tez: ITezosApis;
|
298
|
+
eth: IEthApis;
|
299
|
+
base: IBaseApis;
|
300
|
+
}[B] };
|
301
|
+
type TNetworkBlockchainConfig = { [B in TBlockchain]: {
|
302
|
+
tez: IFxhashNetworkConfig;
|
303
|
+
eth: IFxhashNetworkConfig;
|
304
|
+
base: IFxhashNetworkConfig;
|
305
|
+
}[B] };
|
306
|
+
type IFxhashConfig = {
|
307
|
+
networks: { [N in TBlockchainNetwork]: { [B in TBlockchain]: {
|
308
|
+
contracts: TBlockchainContacts[B];
|
309
|
+
config: TNetworkBlockchainConfig[B];
|
310
|
+
apis: TBlockchainApis[B];
|
311
|
+
} } };
|
312
|
+
envs: { [K in TEnv]: {
|
313
|
+
apis: IFxhashApis;
|
314
|
+
config: IFxhashEnvConfig;
|
315
|
+
} };
|
316
|
+
};
|
317
|
+
type IFxhashConfigSingleEnv = { [B in TBlockchain]: {
|
318
|
+
contracts: TBlockchainContacts[B];
|
319
|
+
config: TNetworkBlockchainConfig[B];
|
320
|
+
apis: TBlockchainApis[B];
|
321
|
+
} } & {
|
322
|
+
apis: IFxhashApis;
|
323
|
+
config: IFxhashEnvConfig;
|
324
|
+
};
|
325
|
+
//#endregion
|
326
|
+
//#region src/api/fxhash.d.ts
|
327
|
+
// list of APIs dev leverages
|
328
|
+
declare const fxhashDevApis: IFxhashApis;
|
329
|
+
// list of APIs for when fxhash is ran locally
|
330
|
+
// The ports must correspond to the ports the services are running on
|
331
|
+
// defined in the root docker compose file of the monorepo
|
332
|
+
|
333
|
+
// list of APIs prod leverages
|
334
|
+
declare const fxhashPrdApis: IFxhashApis;
|
335
|
+
/**
|
336
|
+
* Given some env, returns the associated APIs config.
|
337
|
+
*/
|
338
|
+
//#endregion
|
339
|
+
//#region src/config.d.ts
|
340
|
+
/**
|
341
|
+
* --------------------------------------------------------
|
342
|
+
*/
|
343
|
+
declare const fxhashConfig: IFxhashConfig;
|
344
|
+
declare const localConfig: IFxhashConfigSingleEnv;
|
345
|
+
declare const devConfig: IFxhashConfigSingleEnv;
|
346
|
+
declare const prdConfig: IFxhashConfigSingleEnv;
|
10
347
|
declare let config: IFxhashConfigSingleEnv;
|
11
348
|
declare function setConfig(userConfig: Partial<IFxhashConfigSingleEnv>): IFxhashConfigSingleEnv;
|
12
|
-
|
13
|
-
|
349
|
+
//#endregion
|
350
|
+
//#region src/helpers.d.ts
|
351
|
+
declare function getDockerInternalUrl(url: string): string;
|
352
|
+
declare const isProd: boolean;
|
353
|
+
declare const isLocal: boolean;
|
354
|
+
declare const isDockerLocal: boolean;
|
355
|
+
declare function getEnv(): TEnv;
|
356
|
+
//#endregion
|
357
|
+
//#region src/utils/ipfs.d.ts
|
358
|
+
declare enum EGatewayIpfs {
|
359
|
+
FXHASH = "FXHASH",
|
360
|
+
FXHASH_SAFE = "FXHASH_SAFE",
|
361
|
+
IPFSIO = "IPFSIO",
|
362
|
+
}
|
363
|
+
/**
|
364
|
+
* Given a gateway enum, outputs the http url root of the gateway
|
365
|
+
*/
|
366
|
+
declare function ipfsGatewayRoot(gateway: EGatewayIpfs): string;
|
367
|
+
/**
|
368
|
+
* Returns the CID or a resource, whether it's already a CID or an ipfs://<CID> resource
|
369
|
+
* @param resource either a CID or a ipfs://<CID> string
|
370
|
+
*/
|
371
|
+
declare function ipfsCidFromUriOrCid(resource: string): string;
|
372
|
+
/**
|
373
|
+
* Given a CID or ipfs://<CID>, returns an URL to a gateway pointing to the resource
|
374
|
+
* @param resource the resource input, either a CID or ipfs://<CID>
|
375
|
+
* @param gateway the gateway URL to use for the resource
|
376
|
+
*/
|
377
|
+
declare function ipfsGatewayUrl(resource: string | null | undefined, gateway?: EGatewayIpfs): string;
|
378
|
+
/**
|
379
|
+
* given a URI (either ipfs://<CID>, onchfs://<CID> or temp://<CID>),
|
380
|
+
* returns the URL to the resource
|
381
|
+
*/
|
382
|
+
declare function proxyUrl(uri: string): string;
|
383
|
+
//#endregion
|
384
|
+
//#region src/utils/contracts.d.ts
|
385
|
+
declare const tezosContractPrefixesByContractAddress: Record<string, string>;
|
386
|
+
declare function getObjktIdFromContract(contract: string, id: string): string;
|
387
|
+
//#endregion
|
388
|
+
//#region src/errors/metadata.d.ts
|
389
|
+
declare class AppMetadataInvalidTypeError extends RichError {
|
390
|
+
name: "AppMetadataInvalidTypeError";
|
391
|
+
messages: {
|
392
|
+
dev: string;
|
393
|
+
};
|
394
|
+
}
|
395
|
+
declare class AppMetadataMissingPropertiesError extends RichError {
|
396
|
+
name: "AppMetadataMissingPropertiesError";
|
397
|
+
constructor(messages: IRichErrorMessages);
|
398
|
+
constructor(properties: string[]);
|
399
|
+
}
|
400
|
+
declare const AppMetadataErrors: (typeof AppMetadataInvalidTypeError | typeof AppMetadataMissingPropertiesError)[];
|
401
|
+
type AppMetadataError = RichErrorUnion<typeof AppMetadataErrors>;
|
402
|
+
//#endregion
|
403
|
+
//#region src/config/metadata.d.ts
|
404
|
+
/**
|
405
|
+
* Test whether some value is a valid {@link IAppMetadata} interface. If not,
|
406
|
+
* the issue causing it to be invalid is returned as a failure.
|
407
|
+
* @param value Any value which should be tested for being valid App Metadata
|
408
|
+
* @returns A Result with void success or failure with the issue
|
409
|
+
*/
|
410
|
+
declare function isAppMetadataValid(value: any): Result<void, AppMetadataError>;
|
411
|
+
//#endregion
|
412
|
+
export { BlockchainIdentifier, BlockchainIdentifiers, EGatewayIpfs, GPURenderingConfig, IAppMetadata, IEthApis, IEthContracts, IFxhashApis, IFxhashConfig, IFxhashConfigSingleEnv, IFxhashEnvConfig, IFxhashNetworkConfig, ITezosApis, ITezosContracts, TBlockchain, TBlockchainNetwork, TEnv, TEnvName, config, fxhashConfig as default, fxhashConfig, devConfig, ethTestnetApis, ethTestnetContracts, fxhashDevApis, fxhashPrdApis, getDockerInternalUrl, getEnv, getObjktIdFromContract, ipfsCidFromUriOrCid, ipfsGatewayRoot, ipfsGatewayUrl, isAppMetadataValid, isDockerLocal, isLocal, isProd, localConfig, prdConfig, proxyUrl, setConfig, tezosContractPrefixesByContractAddress, tezosMainnetApis, tezosMainnetContracts, tezosTestnetApis, tezosTestnetContracts };
|
413
|
+
//# sourceMappingURL=index.d.ts.map
|