Skip to main content

Responding To Sign Transactions Requests

Responding to a sign transactions request

Once our provider object has been initialized, we can simply listen to events and respond:

const providerId = '02657eaf-be17-4efc-b0a4-19d654b2448e';

// initialized provider
provider.onSignTransactions(({ params }) => {
// ... using the `params.txns` parameter, the provider signs the transactions and returns the base64 encoded signed transactions

return {
providerId,
stxns: [
'gqNzaWfEQ...',
],
};
});
caution

If this method is not supported, then a MethodNotSupportedError should be thrown.

caution

If there is a group of atomic transactions, but the computed group ID doesn't match the assigned ID, then a InvalidGroupIdError should be thrown.

caution

If any of the transactions are malformed, then a InvalidInputError should be thrown.