Hope Wallet SDK
Docs
Message (sign a tx)
message() and MessagePanel — Hope Wallet broadcasts. Camera scan does not return txhash.
WalletMessage is { typeUrl, value } — the SDK does not whitelist types on the QR path.
Use message signing after connect, when the app already knows which hope1… address should sign.
import { MessagePanel } from '@hopenetwork/wallet/react';
<MessagePanel
origin={origin}
chainId="hope-testnet-2"
account={address}
title="Send"
preview={{ title: 'Send', summary: '1 uhope on hope-testnet-2' }}
messages={[{
typeUrl: '/cosmos.bank.v1beta1.MsgSend',
value: {
fromAddress: address,
toAddress: address,
amount: [{ denom: 'uhope', amount: '1' }],
},
}]}
onComplete={(r) => {
if (r.mode === 'in-app') console.log(r.txhash);
// camera QR: poll LCD yourself
}}
/>CosmWasm:
{
typeUrl: '/cosmwasm.wasm.v1.MsgExecuteContract',
value: { sender, contract, msg: { swap: {} }, funds: [] },
}Authorize a hosted node (signer = payout wallet, not the operator):
{
typeUrl: '/hope.incentives.v1.MsgAuthorizeOperator',
value: { payoutRecipient, operator, label: 'hosted' },
}Preview tips:
- keep
preview.titleshort and human - put the important action in
preview.summary - include a
messagesarray inside preview when you want richer wallet UI - for staking / sends / multi-message flows, label the action explicitly instead of relying on generic type names
Connect payloads and sign payloads are not interchangeable. Sign has preview / transaction and must not have session_id.
QR behavior:
- sign QR payloads are capped at about 2800 characters
- the SDK renders them larger for better phone-camera scanning
- if a flow is too large for practical QR scanning, users can still use Open Hope Wallet
Result:
{ mode: 'in-app', txhash }when the user approves inside Hope Wallet's in-app browser{ mode: 'qr' }when the page showed a camera-scan flow
For camera-scan signing, poll Explorer / LCD / RPC yourself for the new tx hash after approval.
Try the Tx tool.
