-
-
Notifications
You must be signed in to change notification settings - Fork 27
feat: enhance Djed-SDK by shipping pre-configured network variables #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Rav1Chauhan
wants to merge
2
commits into
DjedAlliance:main
Choose a base branch
from
Rav1Chauhan:feat/preconfigured-network-variables
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+44
−14
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,23 +1,50 @@ | ||
| export const BC_DECIMALS = 18; | ||
| export const SCALING_DECIMALS = 24; | ||
| export const TRANSACTION_USD_LIMIT = 10000; | ||
| export const FEE_UI=0.01; | ||
| export const FEE_UI = 0.01; | ||
| export const REFRESH_PERIOD = 4000; | ||
| export const CONFIRMATION_WAIT_PERIOD = REFRESH_PERIOD + 1000; | ||
|
|
||
| export const TRANSACTION_VALIDITY = { | ||
| OK: "Transaction is valid.", | ||
| WALLET_NOT_CONNECTED: "Wallet not connected", | ||
| WRONG_NETWORK: "Wallet connected to the wrong network", | ||
| NONNUMERIC_INPUT: "Amount has to be a number", | ||
| NEGATIVE_INPUT: "Amount cannot be negative", | ||
| ZERO_INPUT: "Amount cannot be zero", | ||
| INSUFFICIENT_BC: "Insufficient balance", | ||
| INSUFFICIENT_SC: "Insufficient StableCoin balance", | ||
| INSUFFICIENT_RC: "Insufficient ReserveCoin balance", | ||
| RESERVE_RATIO_LOW: "Reserve ratio would drop below the minimum", | ||
| RESERVE_RATIO_HIGH: "Reserve ratio would rise above the maximum", | ||
| TRANSACTION_LIMIT_REACHED: "Transaction limit reached" | ||
| }; | ||
| OK: "Transaction is valid.", | ||
| WALLET_NOT_CONNECTED: "Wallet not connected", | ||
| WRONG_NETWORK: "Wallet connected to the wrong network", | ||
| NONNUMERIC_INPUT: "Amount has to be a number", | ||
| NEGATIVE_INPUT: "Amount cannot be negative", | ||
| ZERO_INPUT: "Amount cannot be zero", | ||
| INSUFFICIENT_BC: "Insufficient balance", | ||
| INSUFFICIENT_SC: "Insufficient StableCoin balance", | ||
| INSUFFICIENT_RC: "Insufficient ReserveCoin balance", | ||
| RESERVE_RATIO_LOW: "Reserve ratio would drop below the minimum", | ||
| RESERVE_RATIO_HIGH: "Reserve ratio would rise above the maximum", | ||
| TRANSACTION_LIMIT_REACHED: "Transaction limit reached" | ||
| }; | ||
|
|
||
|
|
||
| export const NETWORKS = { | ||
| sepolia: { | ||
| name: "Sepolia", | ||
| chainId: 11155111, | ||
| rpcUrl: null, // Developers should provide their RPC endpoint | ||
| djedAddress: null, // DJED contract address for Sepolia | ||
| oracleAddress: null // Oracle contract address for Sepolia | ||
| }, | ||
|
|
||
| mainnet: { | ||
| name: "Ethereum Mainnet", | ||
| chainId: 1, | ||
| rpcUrl: null, // Developers should provide their RPC endpoint | ||
| djedAddress: null, // DJED contract address for Mainnet | ||
| oracleAddress: null // Oracle contract address for Mainnet | ||
| } | ||
| }; | ||
|
|
||
| export const getNetworkConfig = (networkName = "sepolia") => { | ||
| const config = NETWORKS[networkName]; | ||
|
|
||
| if (!config) { | ||
| throw new Error(`Unsupported network: ${networkName}`); | ||
| } | ||
|
|
||
| return config; | ||
| }; | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.