Hello,
I have scenario, but I am not sure whether /v1/resource_provider/request_transaction is the right API to use.
Let’s say there are 3 accounts,
sender - One of our customers, customer has private key, customer creates and signs the transaction and send us, we just execute API requests and do internal accounting.
recipient - Same as sender, just another customer. In this case sender will send some amount of EOS to recipient.
payer - This is our account used by our application. We have the private key. We use this account to create other customer accounts like sender, recipient etc…
We want to abstract away implementation details of EOS like CPU, RAM, NET. sender sends 10 EOS to recipient and recipient has 10 EOS in this account.
I tried to use resource_provider/request_transaction API.
1.
If I get this response from resource_provider API
{
"code": 400,
"message": "Network resources not required by this account.",
"data": {}
}
I proceed with push_transaction
. (Since we are delegating some small amount of CPU and NET when we create accounts.)
2.
In case of 200, can I execute this transaction as is, after the verification?
Or should transaction be signed again by client (in this case sender).
I was confused about this paragraph
With the modified transaction verified to match what is expected, the application can either create a signature themselves for this new transaction or relay the transaction to the end user for signature in their preferred wallet. Once the user has signed this modified transaction, it can be broadcast to the blockchain and the resource provider will cover the costs.
In following article
So what does it mean “application can either create a signature themselves”. In this case since we do not have the private key of sender, how can we sign ? And relaying to user also not possible for our case, because this is one way flow in our application. (So let’s say client has a mobile device, and transaction can be created and signed by mobile device, server cannot push a transaction to mobile device to be signed.)
3.
In case of 402, we want to pay fee from payer’s account which we have the private key. Can we sign this modified transaction with payer private key and execute so all costs are deducted from payer’s account ?
I checked this example, so my understanding it is not possible and sender should sign again modified transactions which are returned by /v1/resource_provider/request_transaction