TorqueTorque

Search docs

Search Torque documentation pages & sections

Wallets

Embed smart wallets in your app: your brand, your signup, your balance and deposit screens. Each user gets deposit addresses and one unified balance in your UI. Torque holds custody and routes settlement invisibly; you map your user id to their wallet.

Private-Label Model

Partners white-label at the product layer: your brand, your signup, your balance and deposit screens. Provision and reads run on your server with a business API key. Onchain execution always requires user consent in your shell because Torque holds custody and your API key must never sign user transactions.

SurfaceYour AppTorque
Provision, balance, depositsFully embedded in your appCustody, addresses, portfolio READ, optional deposit webhooks
Cash-out, trade, transferYour UI — user confirms in your shellSigns only after attested consent; delegated JWT for POST /execute/**

Manage keys and setup in the developer portal.

Quick Start

#StepAction
1API keyPortal → Overview → Create key. Server only.
2Provisiontorque.wallets.ensure({ externalUserId, email }) or POST /accounts/end-users
3DepositsReturn addresses. Poll GET …/deposits or optional webhook in Settings
4ExecuteUser confirms in your app → your server calls POST /execute/** with delegated JWT
5CallbacksPortal Settings → your app URL for execute consent completion
6TestEnable test execute callback in Settings before your app ships

Provision

Call on signup. externalUserId is your stable user id; email is their step-up identity for execute in your flow (not a Torque app signup). Idempotent on externalUserId.

server.ts
import { createTorqueFromEnv } from 'torque-node'
const torque = createTorqueFromEnv()
const wallet = await torque.wallets.ensure({
  externalUserId: 'user_48291',
  email: 'user@example.com',
})

HTTP equivalent:

provision.sh
curl -sS -X POST "https://app.torque.fi/api/v1/accounts/end-users" \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user_48291",
    "email": "user@example.com"
  }'

Response includes addresses, portfolioSummary, and capabilities. Full accounts reference: below.

Deposits

Return addresses in your deposit UI. Encode each address in a client-side QR: QR value is the raw address string from addresses.evm, addresses.solana, or addresses.btcDeposit. No server QR endpoint.

Poll GET /accounts/end-users/{id}/deposits or set an optional deposit webhook in portal Settings (end_user.deposit.detected). Preview QR in the developer portal wallet row.

Execute in Your App

Trades, transfers, and withdrawals are confirmed in your UI. Your API key provisions wallets and reads balances; it never signs user transactions. After the user confirms in your product, your server calls POST /execute/** with a delegated JWT.

StageModelFit
TargetEmbedded branded consent + partner attestationPrivate-label confirm UI in your shell; Torque validates partner-signed requests and optional user step-up.
RoadmapScoped delegate sessionsReuse consent after first approval; tighter scopes and amount caps without a full redirect every trade.
v1 shippingConnect callback completionCustody plumbing for launch: consent completion returns to your callback; exchange code for delegated JWT on your server.

Not supported: Mint wallet JWTs with sk_live_… alone; Unattended server sweeps without user or attested partner consent; Export seed phrases or owner keys to partners.

Portal → Settings → Execute callbacks → enter your app URL (e.g. https://yourapp.com). Torque registers callback https://yourapp.com/torque/connect/callback. Add that route on your backend. Consent completion returns to your app with ?code=….

v1 shipping note: Shipping today: consent completion returns to your app via a Connect callback and delegated JWT. Embedded confirm UI in your shell is on the roadmap.

Test execute callback (portal): try before your app is live. Callback: https://developers.torque.fi/connect/callback.

WhoAction
YouSave app URL in developer portal Settings
Your serverPOST /connect/authorize/session (redirect_uri, PKCE, optional externalUserId)
UserConfirms trade or withdrawal in your app
Your serverCallback receives ?code=… → POST /connect/token
Your serverPOST /execute/transfers/… with delegated JWT

Connect details: Connect OAuth, Actions: cash-out, Authentication.

Identity & Recovery

The email you pass at provision is the step-up identity when the user confirms execute in your flow. Use a stable address your users will keep. externalUserId is how you look up the wallet in your systems. Wrong email at provision means a separate wallet; balances are not merged between emails.

Support copy for lost devices: same email → same wallet (email code, passkey, or linked OAuth). Lost email access: contact hello@torque.fi for verified help, not self-serve. Details: Account Recovery for integrators.

Accounts API

Caller identity: business (sk_live_…) or wallet (Smart Wallet JWT). Metadata only; no fund movement.

CanonicalLegacy AliasAuthUse When
GET /accounts/business/business/mesk_live_…Verify merchant key, display business name, check status
GET /accounts/wallet/wallet/meSmart wallet JWTResolve EVM + Solana addresses for EXECUTE; confirm session
POST /accounts/end-usersNonesk_live_… + entitlementProvision per-user wallets (EVM, Solana, BTC deposit); idempotent
GET /accounts/end-users/{id}Nonesk_live_… + entitlementFetch addresses for a partner externalUserId
GET /accounts/end-users/{id}/depositsNonesk_live_… + entitlementList deposit events for a partner end-user wallet

GET /accounts/business

business-me.sh
export TORQUE_KEY="sk_live_…"

curl -sS "https://app.torque.fi/api/v1/accounts/business" \
  -H "Authorization: Bearer $TORQUE_KEY" \
  | jq '.'

GET /accounts/wallet

User + EVM/Solana addresses for the JWT; confirm before POST /execute/**. There is no partner API to mint wallet JWTs; see Authentication.

wallet-me.sh
export WALLET_JWT="<smart_wallet_jwt>"

curl -sS "https://app.torque.fi/api/v1/accounts/wallet" \
  -H "Authorization: Bearer $WALLET_JWT" \
  | jq '.'

FAQ

Do my users need a Torque account?

No. They are your customers. You provision wallets with externalUserId on your server; they see your brand, your signup, and your balance UI. They never create a Torque consumer account or use torque.fi.

Is this a white-label or private-label wallet?

Yes at the product layer: your brand, signup, balance, deposit, and confirm UI. Torque handles custody, routing, and settlement invisibly behind your API key.

Why is email required at provision?

Email is the step-up identity for execute consent in your flow — not a Torque app signup. externalUserId is your stable app user id for API lookups.

How do deposits work?

Return addresses from provision in your UI. Encode each address in a client-side QR (EVM, Solana, or BTC). Poll GET …/deposits or configure an optional deposit webhook in portal Settings.

How does cash-out work?

User taps withdraw in your app. Your server starts the flow; the user confirms in your product; consent completion returns to your callback; exchange for a delegated JWT; call POST /execute/**. v1 shipping uses Connect callback plumbing; embedded confirm UI in your shell is on the roadmap.

What if a user loses email access?

Self-serve recovery stops. Escalate to your support team and Torque at hello@torque.fi for verified migration help. See Account Recovery for the full playbook.

Questions or corrections? hello@torque.fi