-
Notifications
You must be signed in to change notification settings - Fork 4
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
Read the min amount of BTC deposit from the SDK #303
Conversation
✅ Deploy Preview for acre-dapp-testnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
aee0331
to
836a300
Compare
Add `fromSatoshi` fn that converts an amount from `1e8` to `1e18` token precision. Also here we remove optional `fromPrecision` param in `toSatoshi` fn - we assume we always convert from `1e18` to `1e8` and in `fromSatoshi` we always convert from `1e8` to `1e18`.
The minimum amount of BTC deposit should be taken from `BitcoinDepositor` contract. The amount is in tBTC token precision before export this value in SDK has to be converted to satoshi precision.
Since the minimum staking amount is in bigint, we should standardize it not mix types in the form. This approach also gets rid of the double conversion of tokenBalance to bigint in the `TokenBalanceInput` component and validation method.
The BigInt constructor also accepts the value bigint. There is no need to check whether the number is of type bigint to avoid the constructor.
e75be7e
to
7e0c787
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic comes from #281. To avoid waiting for this PR, I copied this solution.
dapp/src/components/TransactionModal/ActiveStakingStep/StakeFormModal/index.tsx
Show resolved
Hide resolved
dapp/src/components/TransactionModal/ActiveUnstakingStep/UnstakeFormModal/index.tsx
Outdated
Show resolved
Hide resolved
We decided not to call the operation stake in the dapp, so for consistency, we align the naming here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 Resolve file conflicts, please.
@r-czajkowski could you take a look at the SDK part?
Closes #234
Closes #336
This PR reads the minimum amount of BTC deposit from the SDK and saves it in the redux store.
What has been done:
useFetchSdkData
to load all needed data from the SDKbigint
fortokenBalnce
.CurrencyBalance
to pass the amount inbigint
One note: the contracts have not been deployed yet. Therefore, an error will appear in the console
TypeError: this.instance.minDepositAmount is not a function
However, When the contracts are re-deployed I will update the code and the error will disappear.