Skip to content
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

Linked transactions #10

Open
2 tasks
stefdegroot opened this issue Jan 31, 2023 · 0 comments
Open
2 tasks

Linked transactions #10

stefdegroot opened this issue Jan 31, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request format Formatting changes

Comments

@stefdegroot
Copy link
Member

stefdegroot commented Jan 31, 2023

Linked transactions to sign single depended transactions at once where possible.

Example:

const txns = [
	{
		description: "Opt-into USDCa.",
		blob: "",
		txID: "BHGYUJ6URPNUXIKKWCCF4GSDHOLEZENF5DL3MZUXF3OGX45GWZBA",
		signers: [
			"E3GZF5GUOQDW52TZ4X3PU5YR34447BOTVL6X3OOW3CB5EPHWIEISXK5BCI"
		],
		dependsOn: null,
		sSignature: ""
	},
	{
		description: "Claim USDCa from the revenue sink.",
		blob: "",
		txID: "KHBRJZ2LLIJOUOG6EC7OCIRZFWIPUJ6S55TAZCAOQS2I7V367SIQ",
		signers: [
			"E3GZF5GUOQDW52TZ4X3PU5YR34447BOTVL6X3OOW3CB5EPHWIEISXK5BCI"
		],
		dependsOn: "BHGYUJ6URPNUXIKKWCCF4GSDHOLEZENF5DL3MZUXF3OGX45GWZBA",
		sSignature: ""
	}
]

This way the frontend can be programmed based on the transaction array, dynamically creating an interface with two stages instead of one. In some cases transactions can not be grouped, but can be created already, like with this opt-in example.

We already know what the claim transaction format will be, we just can not send this as a group since the claim transaction can not be send in a round that the user is not opted into yet. So we make the transaction depended and now we know to wait with sending the second until after the first one went trough. (in this case it would not have mattered for signing, only for submitting)

To make the dependency system east to use we probably want to provide a submit transactions function that handles this.

Tasks:

  • add dependsOn property to transaction return format
  • implement a submitTransactions function, which takes into account the dependency order.
@stefdegroot stefdegroot added enhancement New feature or request format Formatting changes labels Jan 31, 2023
@stefdegroot stefdegroot self-assigned this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request format Formatting changes
Projects
None yet
Development

No branches or pull requests

1 participant