Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tron-siwx-sign-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@reown/appkit-adapter-tron': patch
---

Implement message signing in the TRON adapter. `TronAdapter.signMessage` previously returned an empty signature, which broke SIWX / Reown Authentication (the empty signature was rejected by the server). It now delegates to the active connector's `signMessage`, producing a real signature.
8 changes: 8 additions & 0 deletions apps/laboratory/src/components/DemoContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ export default function DemoContent({
showActions={false}
/>
) : null}
{tronAdapter ? (
<AppKitWalletButtons
title="TRON Wallet Buttons"
namespace={isMultiChain ? 'tron' : undefined}
wallets={ConstantsUtil.TronWalletButtons}
showActions={false}
/>
) : null}
</>
)
}
2 changes: 1 addition & 1 deletion apps/laboratory/src/constants/appKitConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export const appKitConfigs = {
},
'reown-authentication': {
...commonAppKitConfig,
adapters: ['ethers', 'solana', 'bitcoin'],
adapters: ['ethers', 'solana', 'bitcoin', 'tron'],
networks: ConstantsUtil.AllNetworks,
siwx: new ReownAuthentication(),
siwxReown: true
Expand Down
1 change: 1 addition & 0 deletions apps/laboratory/src/utils/ConstantsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export const ConstantsUtil = {
'frontier'
] as Wallet[],
BitcoinWalletButtons: ['walletConnect', 'xverse', 'leather', 'okx', 'phantom'] as Wallet[],
TronWalletButtons: ['walletConnect'] as Wallet[],
Socials: [
'google',
'github',
Expand Down
17 changes: 15 additions & 2 deletions packages/adapters/tron/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,21 @@ export class TronAdapter extends AdapterBlueprint<TronConnector> {
})
}

override async signMessage(): Promise<AdapterBlueprint.SignMessageResult> {
return Promise.resolve({ signature: '' })
override async signMessage(
params: AdapterBlueprint.SignMessageParams
): Promise<AdapterBlueprint.SignMessageResult> {
const connector = (params.provider as TronConnector | undefined) ?? this.getActiveConnector()

if (!connector) {
throw new Error('TronAdapter:signMessage - connector is undefined')
}

const signature = await connector.signMessage({
message: params.message,
from: params.address
})

return { signature }
}

override async sendTransaction(): Promise<AdapterBlueprint.SendTransactionResult> {
Expand Down
Loading