Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea28890
commit a171968
Showing
11 changed files
with
274 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
TX_SUBMIT_PROVIDER=blockfrost | ||
TX_SUBMIT_HTTP_URL=http://localhost:3000 | ||
WALLET_PROVIDER=blockfrost | ||
REWARDS_PROVIDER=blockfrost | ||
ASSET_PROVIDER=blockfrost | ||
STAKE_POOL_PROVIDER=stub | ||
NETWORK_INFO_PROVIDER=blockfrost | ||
CHAIN_HISTORY_PROVIDER=blockfrost | ||
BLOCKFROST_API_KEY=testnetNElagmhpQDubE6Ic4XBUVJjV5DROyijO # A valid api key can be obtained at https://blockfrost.io/ | ||
NETWORK_ID=0 | ||
MNEMONIC_WORDS="actor scout worth mansion thumb device mass pave gospel secret height document merge text broom kind lesson invest across estate erase interest end century" | ||
WALLET_PASSWORD=some_password | ||
POOL_ID_1=pool1euf2nh92ehqfw7rpd4s9qgq34z8dg4pvfqhjmhggmzk95gcd402 | ||
POOL_ID_2=pool1fghrkl620rl3g54ezv56weeuwlyce2tdannm2hphs62syf3vyyh | ||
OGMIOS_URL=ws://localhost:1337 | ||
LOGGER_MIN_SEVERITY=debug | ||
KEY_AGENT=InMemory | ||
UTXO_PROVIDER=blockfrost | ||
CARDANO_WALLET_URL=http://localhost:8090/v2 | ||
FAUCET_SEED_WORDS="fire method repair aware foot tray accuse brother popular olive find account sick rocket next" | ||
FAUCET_PROVIDER="CardanoWalletFaucetProvider" | ||
FAUCET_PROVIDER_PARAMS='{"url":"http://localhost:8090/v2","mnomonics":"fire method repair aware foot tray accuse brother popular olive find account sick rocket next"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { CardanoWalletFaucetProvider } from "./providers/cardanoWalletFaucetProvider" | ||
import { FaucetProvider } from "./types" | ||
|
||
// Constants | ||
const PARAM_NAME_URL: string = 'url'; | ||
const PARAM_NAME_MNEMONICS: string = 'mnomonics'; | ||
|
||
/** | ||
* Faucet provider factories. | ||
*/ | ||
export class FaucetFactory { | ||
|
||
/** | ||
* Creates a new faucet factory. | ||
* | ||
* @param name The name of the concrete facet provider implementation. | ||
* @param params The parameters to be passed to the concrete implementation constructor. | ||
* | ||
* @returns The new Faucet provider. | ||
* | ||
* @throws if The give provider name is not registered, or the constructor parameters of the providers are either missing or invalid. | ||
*/ | ||
static create(name: string, params: any): FaucetProvider { | ||
|
||
if (name === CardanoWalletFaucetProvider.name) { | ||
|
||
if (!params.hasOwnProperty(PARAM_NAME_URL)) | ||
throw new Error(`${CardanoWalletFaucetProvider.name} missing argument: ${PARAM_NAME_URL}`); | ||
|
||
if (!params.hasOwnProperty(PARAM_NAME_MNEMONICS)) | ||
throw new Error(`${CardanoWalletFaucetProvider.name} missing argument: ${PARAM_NAME_MNEMONICS}`); | ||
|
||
return new CardanoWalletFaucetProvider(params[PARAM_NAME_URL], params[PARAM_NAME_MNEMONICS]); | ||
|
||
} else { | ||
throw new Error(`Faucet provider unsupported: ${name}`); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './types'; | ||
export * from './providers/cardanoWalletFaucetProvider'; | ||
export * from './faucetFactory'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.