extension
extension copied to clipboard
Connecting fails, dev can't sign transactions on local devnet with Leather
Adding conversation with a dev here
Kyran mentioned this may be related to what is mentioned in #6117 and is discussing with Jannik about changes on their end (many).
Additionally shared by the dev who reported this:
Looks like the issue is in the use-submit-stx-transaction.ts file in the Leather extension... I don't see any handler for devnet network, only testnet and mainnet. At least it looks that way with my limited knowledge of the wallet In the networks.hook.ts file
@314159265359879 what version of stacks.js are they using? Do both v6 and 7 have this issue?
@kyranjamie, from the dev:
Is stacks.js it's own thing? I did a "npm list" and I only see these two libraries installed.
├── @stacks/[email protected] ├── @stacks/[email protected] specifically stacks libraries
@kyranjamie update from the dev:
I was out of town for a week... back and updated to (Leather) 6.65.0
It looks like it is submitting transactions to devnet now. I am getting a ton of JsonRpcErrors back though. Is there anything else I need to do?
The errors I've seen are saying the User Cancelled the Transaction, even though the transaction is sent and confirmed successfully.
Any thoughts?
The transaction goes through without any issue, but the
const response = await request('stx_callContract', {...
is wrapped in a try/catch and it falls into the catch block.
The error I'm catching is "JsonRpcError: User rejected transaction signing request"
But I did not reject the transaction and it successfully confirmed. I just seem to be getting this back from the promise (maybe when the popup closes)? I've upgraded everything to the latest Connect libraries and am submitting transactions to testnet.
Pinging @janniks too as he may know more.
Any thoughts on what could cause this exception?
My workflow is:
- Send the transaction using stx_callContract within a try/catch
- When successful, call internal API to save data and create a PENDING record in off-chain database
- Chainhook looks up transaction, and marks it CONFIRMED
The trouble is the JsonRpcError puts me into the catch even though the transaction goes through. This means that I can't provide the user any feedback until the chainhook finally triggers the confirmation workflows to insert the record.
It is functional, but the UI suffers without being able to provide the user PENDING feedback.
To assist... I did see this in rpc-helpers.ts
export async function handleRpcMessage({
method,
path,
port,
requestParams,
requestId,
}: HandleRpcMessageArgs) {
void trackRpcRequestSuccess({ endpoint: method });
const { urlParams, tabId } = makeSearchParamsWithDefaults(port, requestParams);
const { id } = await triggerRequestWindowOpen(path, urlParams);
listenForPopupClose({
tabId,
id,
response: createRpcErrorResponse(method, {
id: requestId,
error: {
code: RpcErrorCode.USER_REJECTION,
message: RpcErrorMessage.UserRejectedSigning,
},
}),
});
}
Would this throw the exception any time the popup closes? Even if it closing itself after the transaction leaves?
@codeonedotzero this is because closing the window is pretty much a cancel action. If you approve the action, it should fire the success event. If you were to immediately close window, this would trigger, but wouldn't matter as the success response promise has already resolved.
Did you not read the defect, or maybe I'm not understanding your response to the issue?
I am approving the message, the transaction is successfully sent to testnet, it successfully confirms.
Still, when the popup closes itself I get the error message from the wallet provider.
- I click Confirm in wallet popup.
- Transaction is submitted to the chain.
- Wallet self closes.
- I get the JsonRpcError that the user rejected the signing request.
I can also confirm that I too receive that error response right after a tx is successfully broadcasted
Was this resolved in 6.65.1?
I'm noticing I'm not seeing this error anymore. Not sure if it was because of something I changed or your new version.
I can also confirm that I too receive that error response right after a tx is successfully broadcasted
![]()
@ECBSJ Are you still seeing the issue with 6.65.1 of the Leather extension?
Yes I still do. Looks like I get it on many methods such as getAddresses:
I'm on Leather v6.65.2 @stacks/connect v8.1.8
This issue is stale because it has been open for 60 days with no activity.