Conversation
evgenykuzyakov
left a comment
There was a problem hiding this comment.
Please rebase on top of dev branch. See https://github.com/NearSocial/VM/blob/master/CONTRIBUTING.md
| if (lastReceiverId !== action.contractName) { | ||
| transactions.push({ | ||
| receiverId: action.contractName, | ||
| actions: [{ type: "FunctionCall", params: action }], | ||
| }); | ||
| } else { | ||
| transactions[transactions.length - 1].actions.push({ | ||
| type: "FunctionCall", | ||
| params: action, | ||
| }); | ||
| } |
There was a problem hiding this comment.
You still need to limit the max gas amount per transaction. As 2FA contracts are not the issue, the max gas should be 300Tgas
| Carefully! You add a full access key; with this key | ||
| you can sign any transaction on behalf of your | ||
| account. The key has full access to your tokens. |
There was a problem hiding this comment.
I think we should display the warning message at the top of the confirmation window.
Also display a warning message for all non default actions. E.g. contract deploy on your account, all key actions, account deletion.
| <div> | ||
| <span className="text-secondary">Code:</span> | ||
| <span className="font-monospace"> | ||
| {action.params.code} |
There was a problem hiding this comment.
What's the format of the code? Should we display just the base58 hash?
| {displayGas(action.params.gas || TGas.mul(30))} | ||
| </span> | ||
| </div> | ||
| <Markdown text={jsonMarkdown(action.params.args)} /> |
There was a problem hiding this comment.
Someone asked me to include binary data here. Not sure how we want to handle it. We can always add this later.
| import { Markdown } from "./Markdown"; | ||
| import { displayGas, displayNear, Loading } from "../data/utils"; | ||
| import { useNear } from "../data/near"; | ||
| import { formatNearAmount } from "near-api-js/lib/utils/format"; |
There was a problem hiding this comment.
I don't like the implementation of the formatNearAmount. It doesn't understand yoctoNear. Let's stick with displayNear for consistency. We can fix it later
|
@azbang This is great! Would you be able to push this PR through the finish line? |
Added Near.signAndSendTransactions for support all types actions. The method is fully compatible with the wallet-selector format. For example:
Also added UI for confirmation modal. You can test it on my gateway:
https://call-any-actions-near-social.surge.sh/#/azbang.near/widget/ExportAccount