Dapp Wallet Integration
Two steps:
Connect popup to obtain the user address
Sign popup to review/PIN/broadcast and get
txHash
1) Install
npm i @newblet/sign-sdk
# or: pnpm add @newblet/sign-sdk / yarn add @newblet/sign-sdk2) Connect — get address
import { openNewbletConnectPopup } from '@newblet/sign-sdk'
async function onConnect(){
const { address } = await openNewbletConnectPopup({
walletUrl: 'https://newblet.com', // `${walletUrl}/connect`
state: `connect-${Date.now()}`
})
console.log(address)
}Errors (Connect): USER_REJECTED, TIMEOUT, ENV_NOT_BROWSER
3) Sign — review/PIN/send
Errors (Sign): USER_REJECTED, TIMEOUT, SUBMIT_FAILED, MALFORMED_TX, ENV_NOT_BROWSER
4) User flow
Connect – Address approval

Sign – Review

Sign – PIN

After broadcast, the wallet returns { txHash, state } and closes the popup.
5) Result handling
6) Checklist
Call popups inside click handlers
Cross‑origin dev only:
devAllowAnyOrigin: true(never in production)Use
stateas an idempotency key
Last updated