Canton wallets / Cantor8
Cantor8 wallet integration
Cantor8Adapter is the narrowest integration in this set: through it a dApp can submit transactions and read their status, and nothing else. If your app gates anything on a signed message, this adapter is not the path. It is also the one adapter here whose submit call takes a wallet-SDK-shaped payload rather than the shape the other adapters accept, which is the detail most likely to cost you an afternoon.
What the registry declares
| Transport | QR or popup, opened by the wallet SDK |
|---|---|
| Adapter package | @partylayer/adapter-cantor8 |
| SDK version | >=0.1.0 |
| Networks | devnet, mainnet |
| CIP-0103 | Not declared |
Install
npm install @partylayer/react @partylayer/adapter-cantor8Construct the adapter
import { Cantor8Adapter } from '@partylayer/adapter-cantor8';
// dappUrl defaults to the page origin, which is what you want in a browser app.
const cantor8 = new Cantor8Adapter();
// Override only when the origin the wallet should see differs from the page's:
// new Cantor8Adapter({ dappUrl: 'https://app.example.com' })Register it
Pass the adapter to PartyLayerKit. Everything else, the button and the modal, is the same for every wallet.
import { PartyLayerKit, ConnectButton } from '@partylayer/react';
export default function App() {
return (
<PartyLayerKit network="devnet" adapters={[cantor8]}>
<ConnectButton />
</PartyLayerKit>
);
}Connection flow
The adapter passes a dApp URL into the wallet SDK popup handshake, defaulting to the page origin. The wallet SDK owns the popup and the postMessage channel back to your page.
What the transport means for you
The origin your page runs on is part of the handshake, so a deployment whose public origin differs from the one the browser sees, behind a proxy or on a preview URL, is the case to check first when a handshake never completes. Overriding dappUrl exists for exactly that, and is not something a normal browser app needs to set.
What this adapter supports
| Capability | Call | Through this adapter |
|---|---|---|
| Sign message | useSignMessage() | Not available |
| Sign transaction | useSignTransaction() | Not available |
| Submit transaction | useSubmitTransaction() | Yes |
| Report transaction status | submit result | Yes |
| Switch network | client.switchNetwork() | Not available |
| Multi-party | multi-party flows | Not available |
Not available, and why
- signMessage
- The registry entry declares signMessage: false and Cantor8Adapter implements no signMessage path. useSignMessage() will not work through this adapter.
- signTransaction
- The registry entry declares signTransaction: false.
Things that will catch you out
Troubleshooting
Every symptom below is a real rejection path in @partylayer/adapter-cantor8, quoted from the adapter rather than reconstructed.
| Symptom | Cause | What to do |
|---|---|---|
| "Cantor8 returned no account after connect" | The popup handshake resolved but carried no account for the adapter to build a session from. | Treat it as a failed connect and retry. Check that the origin in the handshake matches the origin the browser is actually on. |
| submitTransaction rejects with a message about signedTx shape | The payload was not the wallet SDK signAndExecute input this adapter forwards. | Build { partyId, commandId, commandsJson } and pass disclosedContracts and note when you have them. The rejection names the required keys. |
| "Browser environment required" | A connect call ran with no window available, typically during server-side rendering. | Move the call into a client-side effect. |
Related
- Quick Start builds a working app around this adapter.
- Wallets and adapters covers registration, discovery and custom adapters.
- CIP-0103 provider is the standard behind the transports above.
- Cantor8 homepage for anything about the wallet itself. This page describes the PartyLayer adapter, not the wallet's own SDK.
Other wallets
Console Wallet · 5N Loop · Bron · Nightly · WalletConnect