Hope
Hope Wallet SDK

Docs

Start here

Connect, sign, sessions, and server-side signing — the fastest path through the Hope Wallet SDK.

Install the package, pick your path, then open the page that matches what you are building.

npm install @hopenetwork/wallet

Default chain: hope-testnet-2. Default LCD: https://test-gateway.hopenetwork.io/api.

1. Connect — get an address

When: you need to know who the user is. No mnemonic on your server.

SDK: connect() or <VerifyWalletPanel />

You get: hope1… address and optional pubkey proof.

Backend: either four HTTP session routes on your origin, or Explorer-style Supabase pairing RPCs.

→ Connect guide · try Wallet lab

import { connect, createHttpTransport } from '@hopenetwork/wallet';

const transport = createHttpTransport({
  baseUrl: `${window.location.origin}/api/hope-wallet`,
});

const { address, pubkeyBase64 } = await connect({
  origin: { name: 'My App', url: window.location.origin },
  chainId: 'hope-testnet-2',
  transport,
  relayUrl: true,
});

2. Message — sign and broadcast

When: the user is already connected and you want Hope Wallet to sign one or more chain messages.

SDK: message() or <MessagePanel />

You get: in-app → txhash; camera QR → poll Explorer / LCD / RPC yourself.

Messages: { typeUrl, value } — bank, staking, gov, CosmWasm, Hope incentives, and more.

→ Message guide · try Tx tool

import { MessagePanel } from '@hopenetwork/wallet/react';

<MessagePanel
  origin={origin}
  chainId="hope-testnet-2"
  account={address}
  preview={{ title: 'Send', summary: '1 HOPE to recipient' }}
  messages={[{
    typeUrl: '/cosmos.bank.v1beta1.MsgSend',
    value: {
      fromAddress: address,
      toAddress: recipient,
      amount: [{ denom: 'uhope', amount: '1000000' }],
    },
  }]}
  onComplete={(r) => {
    if (r.mode === 'in-app') console.log(r.txhash);
  }}
/>

3. Sessions — own your connect backend

When: you use createHttpTransport and need the wallet to POST proof to your server (Discord bots, custom dapps, this portal).

You implement:

MethodPath
POST/api/hope-wallet/sessions
GET/api/hope-wallet/sessions/:id
DELETE/api/hope-wallet/sessions/:id
POST/api/hope-wallet/sessions/:id/confirm

Use a shared store (Redis, KV, DB) on serverless — not in-memory Maps.

Alternative: createSupabaseTransport with hope_wallet_link_* RPCs — no custom HTTP routes.

→ Session API

4. Node — server-side PQ signing

When: a backend or script holds a 24-word mnemonic and must sign without Hope Wallet UI.

SDK: @hopenetwork/wallet/node — never import in a browser bundle.

You get: PQ signature + on-chain txhash.

Requires local @hope/pq and @hope/tx peers until they publish to npm.

→ Node signing

import { signAndBroadcast } from '@hopenetwork/wallet/node';

const { txhash } = await signAndBroadcast({
  mnemonic: process.env.HOPE_MNEMONIC!,
  chainId: 'hope-testnet-2',
  lcd: 'https://test-gateway.hopenetwork.io/api',
  messages: [/* WalletMessage[] */],
});

Choose your transport

SituationTransportrelayUrl
Custom app with own APIcreateHttpTransporttrue (wallet POSTs to /confirm)
Already on Explorer SupabasecreateSupabaseTransportomit
Hope Wallet in-app browsersame as abovenative overlay, no camera

In-app vs QR

ContextConnectSign
Hope Wallet WebViewnative approve{ mode: 'in-app', txhash }
Desktop / mobile browserQR + Open Hope Wallet{ mode: 'qr' } — poll chain for tx

Sign QR payloads: ~2800 character practical limit; SDK renders at 400px for reliable scans.

Next steps

On this page