MCPcopy Create free account
hub / github.com/0xProject/0x-examples / fetchConfig

Function fetchConfig

solana-example/src/config.ts:32–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32export function fetchConfig(): Config {
33 const environmentConfiguration = EnvironmentConfigurationSchema.parse(
34 process.env
35 );
36
37 return {
38 zeroexApiKey: environmentConfiguration.ZEROEX_API_KEY,
39 connection: new Connection(environmentConfiguration.RPC_URL),
40 dryRun: environmentConfiguration.DRY_RUN,
41 keypairConfig: {
42 keypair: environmentConfiguration.PRIVATE_KEY
43 ? Keypair.fromSecretKey(
44 bs58.decode(environmentConfiguration.PRIVATE_KEY)
45 )
46 : Keypair.generate(),
47 isUserProvided: !!environmentConfiguration.PRIVATE_KEY,
48 },
49 };
50}

Callers 1

index.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected