I have walked through the official document and found a page about how to transfer using polkadot-js https://polkadot.js.org/docs/api/examples/promise/make-transfer
const transfer = api.tx.balances.transfer(BOB, 12345);
const hash = await transfer.signAndSend(alice);
I want to know if I can split the signAndSend
method into two and execute at different machines. like in a client machine, in the browser compute the signature.
const transfer = api.tx.balances.transfer(BOB, 12345);
const signature = await transfer.signAsync(alice);
and then in the server side send the transfer transaction.
const mockSigner = createMockSigner(signature); // signature is computed from the client side and send to server over HTTP
const transfer = api.tx.balances.transfer(BOB, 12345);
const res = transfer.send({signer: mockSigner});
The above example doesn't work, I just want to express if I can do sign and send in different machines.