Is it there a way to generate a transaction for Anchor and sign it without logging in?

Or at least make those two actions into one transaction?

Yeah - you can generate transactions for users without requiring them to be logged in. It does require you to work more directly with the libraries though and implement whatever logic you need. You’d use the eosio-signing-request library to craft the request directly and then present it to the user however you need to.

I believe this demo is still good:

You’d write out your code and craft a transaction, then encode it as an ESR request. Then make something clickable with the link and render a QR of the same thing.

An example would be:

esr://gmNgZGRkAIFXBqEFopc6760yugsVYWBggtKCMIEFRnclpF9eTWUACgAA

or

image

Which you can see here in our request viewer:

https://eosio.to/gmNgZGRkAIFXBqEFopc6760yugsVYWBggtKCMIEFRnclpF9eTWUACgAA

Note these fields, as they’re what will allow you to template in values specific to the user, without knowing exactly who the user is:

authorization: [{
  // '............1' = placeholder for signer account name
  actor: '............1',
  // '............2' = placeholder for signer account permission
  permission: '............2'
}],
data: {
  // '............1' = placeholder for signer account name
  voter: '............1',
  proxy: 'greymassvote',
  producers: [],
}

Feel free to ask questions!

awesome! Thanks for answering!

1 Like

also just tried using the QR code to proxy for greymass, but ran out of CPU. Isn’t Fuel incorporated yet?

Fuel is integrated into anchor-link and it’s sessions, but isn’t part of the eosio-signing-request protocol.

We made the decision early on that whatever ESR requests are sent to the device from within dapps should be respected, and Anchor itself shouldn’t modify those requests to add Fuel. If we did that, the only resource provider that would work would be Fuel, since we’d likely end up invalidating any signatures added to a request from other providers.

If you want Fuel to cover the transaction though - the legacy method of signing should work, as long as the users wallet submits to our API servers. Just add the noop action from this article to the transaction before it’s encoded.