Skip to content

Commit 5cabe45

Browse files
committed
fixed signer issue on contract deploying
1 parent 1b2a0dd commit 5cabe45

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

templates/chain-admin/hooks/contract/useExecuteContractTx.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,19 @@ export const useExecuteContractTx = (chainName: string) => {
9191
throw new Error('RPC endpoint is not available');
9292
}
9393

94+
// Try using the raw Keplr amino signer directly
95+
const chainId = chain.chainId ?? '';
96+
const keplrAminoSigner = (
97+
window as any
98+
).keplr?.getOfflineSignerOnlyAmino(chainId);
99+
100+
if (!keplrAminoSigner) {
101+
throw new Error('Keplr wallet not available');
102+
}
103+
94104
const signingClient = await getSigningJsdClient({
95105
rpcEndpoint,
96-
signer: wallet.getOfflineSigner(chain.chainId ?? '') as any,
106+
signer: keplrAminoSigner as any,
97107
});
98108

99109
return signingClient.signAndBroadcast(address, [msg], fee);

templates/chain-admin/hooks/contract/useInstantiateTx.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,19 @@ export const useInstantiateTx = (chainName: string) => {
8888
throw new Error('RPC endpoint is not available');
8989
}
9090

91+
// Try using the raw Keplr amino signer directly
92+
const chainId = chain.chainId ?? '';
93+
const keplrAminoSigner = (
94+
window as any
95+
).keplr?.getOfflineSignerOnlyAmino(chainId);
96+
97+
if (!keplrAminoSigner) {
98+
throw new Error('Keplr wallet not available');
99+
}
100+
91101
const signingClient = await getSigningJsdClient({
92102
rpcEndpoint,
93-
signer: wallet.getOfflineSigner(chain.chainId ?? '') as any,
103+
signer: keplrAminoSigner as any,
94104
});
95105

96106
const msg = jsd.jsd.MessageComposer.fromPartial.instantiate({

0 commit comments

Comments
 (0)