@chipi-stack/starknet-connector
v0.1.4
Published
"Connect with Chipi" — a starknet-react / get-starknet connector that lets any Starknet dApp connect to a Chipi hosted smart-account wallet (passkey, gasless). No browser extension, no WalletConnect.
Readme
@chipi-stack/starknet-connector
"Connect with Chipi" — a starknet-react / get-starknet connector that lets any Starknet dApp connect to a Chipi hosted smart-account wallet (passkey, gasless via paymaster). No browser extension, no WalletConnect — the same model Argent/Ready's "Web Wallet" and Cartridge Controller use.
npm install @chipi-stack/starknet-connectorUse it
Add one connector to your StarknetConfig:
import { StarknetConfig, publicProvider } from "@starknet-react/core";
import { mainnet } from "@starknet-react/chains";
import { ChipiConnector } from "@chipi-stack/starknet-connector";
const connectors = [
new ChipiConnector(), // "Connect with Chipi"
// ...your other connectors (argent(), braavos(), ...)
];
export function App({ children }) {
return (
<StarknetConfig chains={[mainnet]} provider={publicProvider()} connectors={connectors}>
{children}
</StarknetConfig>
);
}That's it. Your existing useConnect / useAccount flow now offers "Connect
with Chipi", and account.signMessage(...) / account.execute(...) route to the
user's Chipi wallet — gasless, signed with their passkey.
How it works
your dApp Chipi hosted wallet (wallet.chipipay.com)
───────── ──────────────────────────────────────────
ChipiConnector.connect()
└─ opens a popup ───────────► /connect (the user's authenticated wallet)
└─ postMessage ◄──────────► approval UI (passkey + gasless paymaster)
account.execute(calls)
└─ wallet_addInvokeTransaction ─► user approves ─► sponsored tx ─► tx hash- The connector is transport only — it opens the hosted wallet in a popup and
forwards get-starknet
wallet_*RPC calls overpostMessage. It holds no keys and signs nothing itself. - The hosted wallet renders a decoded approval for every sign/execute (it shows the actual intent — token, amount, spender — and hard-blocks typed data it can't read), then runs the real passkey + paymaster path.
account()wraps the channel in astarknet.jsWalletAccount, so the dApp uses a standardAccountInterface.
Options
new ChipiConnector({
walletUrl: "https://wallet.chipipay.com", // hosted wallet base URL (default)
id: "chipi", // connector id
name: "Connect with Chipi", // display name
icon: "data:image/svg+xml;base64,...", // display icon
register: true, // self-register on window (default)
});Compatibility
@starknet-react/core>= 3 (peer) · tested against5.xstarknet>= 8.1.2 (peer) —WalletAccount.connectis identical across 8/9- Starknet mainnet (v1). The wallet is mainnet-only.
Discovery
Instantiating the connector also self-registers the wallet on window
(window.starknet_chipi + a starknet:announceWallet event — the get-starknet /
Starknet-Wallet-Standard discovery path), so dApps that scan for wallets find
"Connect with Chipi" even if they don't import this package — the same mechanism
Cartridge Controller uses. Pass register: false to opt out (e.g. to avoid a
duplicate entry in a picker that already lists the connector explicitly). It's a
no-op during SSR. You can also call registerChipiWallet(swo) directly.
Notes / limits (v1)
- Popup-based (external dApps). The in-app-browser ("parent") mode is in the transport but not exposed yet — the hosted wallet side handles it in a later release.
- Mainnet only — pass a mainnet
provider. - One approval at a time; a dApp that fires two prompts truly simultaneously has its second request rejected (most dApps serialize).
MIT · docs.chipipay.com · example
