-
Notifications
You must be signed in to change notification settings - Fork 17
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
Signing flow explained in README #265
Conversation
Terraform Dev EnvironmentTerraform Format and Style 🖌
|
Terraform Feature Environment (dev-265)Terraform Initialization ⚙️
|
2. Client fetches latest nonce, block hash using obtained recovery PK. | ||
3. Client creates a delegate action with desired actions, such as add or delete key. | ||
4. Client gets the signature from the MPC system using `/sign` endpoint. | ||
5. Client sends the same delegate action to the relayer with obtained signature. |
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.
On step 5, is there a reason why FE need to sends the delegate action to relayer instead of endpoint handles it on its end?
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.
We moved to the generic /sign
endpoint to make the system more flexible and follow the single responsibility principle. Error handling is a nightmare if we need to pass errors from the relayer to the client. Also, we are designing multichain support now. That will make things even worse without this change.
The expected flow for the client is next: | ||
1. Client uses `/user_credentials` endpoint to get the recovery PK. | ||
2. Client fetches latest nonce, block hash using obtained recovery PK. | ||
3. Client creates a delegate action with desired actions, such as add or delete key. |
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.
would be nicer if we either link that contains what delegate action
format looks like, or have a example code 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.
Delegate actions are supported in NAJ and documented here: https://github.com/near/near-api-js/blob/e5570d07b19f618007253ba04b6df8e7af854972/packages/transactions/src/delegate.ts#L37
Terraform Feature Environment Destroy (dev-265)Terraform Initialization ⚙️
|
No description provided.