-
Notifications
You must be signed in to change notification settings - Fork 0
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
DRAFT: TS SDK VC docs #2
Conversation
--- | ||
|
||
import { Callout, Steps, Tabs } from 'nextra/components' | ||
import Link from 'next/link' |
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.
Do you need these imports (except Callout
)?
const userVeiledBalance = await aptos.veiledCoin.getBalance({ accountAddress: user.accountAddress, tokenAddress: TOKEN_ADDRESS }); | ||
``` | ||
|
||
This method returns you user's [`pending` and `actual`](/en/build/smart-contracts/veiled-coin#veiled-coin-store) veiled balances, to [decrypt](/en/build/smart-contracts/veiled-coin#encryption-and-decryption) them, you can use `VeiledAmount` class |
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.
Can we rename VeiledAmount
to VeiledBalace
for consistency?
return { | ||
pending: { | ||
amount: veiledAmountPending.amount, | ||
amountChunked: veiledAmountPending.amountChunked, |
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.
Please, leave small comments here what are amountChunked
and amountEncrypted
And you can do that, by using `aptos.veiledCoin.rolloverPendingBalance`. | ||
|
||
<Callout type="warning"> | ||
Important note, that user's actual balance need to be [normalized](/en/build/smart-contracts/veiled-coin#normalization) before `rollover` operation. |
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.
The contract will revert if you try to normalize the normalized balance.
|
||
Usually you don't need to explicit call [normalization](/en/build/smart-contracts/veiled-coin#normalization-1) | ||
|
||
But in case you want to: |
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.
"In case you want to" -
The explicit normalization is needed only before the rollover. So, maybe we can move this to the rollover section?
const txReceipt = await aptos.waitForTransaction({ transactionHash: txResponse.hash }); | ||
``` | ||
|
||
### Recovery |
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.
Let's call it key rotation, "recovery" term is not obvious here.
|
||
--- | ||
|
||
### Some useful functions |
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.
Explain it?
Co-authored-by: dovgopoly <[email protected]>
Co-authored-by: dovgopoly <[email protected]>
Co-authored-by: dovgopoly <[email protected]>
Description
Checklist
pnpm spellcheck
?pnpm fmt
?pnpm lint
?