@nadohq/mobile-client
v0.53.0
Published
HTTP client for the Nado mobile service API — username claims, profiles, privacy settings, and push notification devices & preferences
Readme
@nadohq/mobile-client
HTTP client for the Nado mobile service API. Manages usernames, public profile lookups, the global trade feed, the follower/following graph, privacy settings, and push notification devices/preferences, using EIP-712 + msgpack signed authentication.
Usage
import { MobileClient, MOBILE_CLIENT_ENDPOINTS } from '@nadohq/mobile-client';
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { ink } from 'viem/chains';
const walletClient = createWalletClient({
account: privateKeyToAccount('0x...'),
chain: ink,
transport: http(),
});
const mobile = new MobileClient({
url: MOBILE_CLIENT_ENDPOINTS.inkMainnet,
walletClient,
});
// Unsigned public lookups
const availability = await mobile.getUsernameAvailability({ displayName: 'Alice.One' });
const [profile] = await mobile.getProfiles({
subaccounts: [{ subaccountOwner: '0x...', subaccountName: 'default' }],
include: { followCounts: true },
});
// Signed operations
await mobile.setUsername({
subaccountOwner: walletClient.account.address,
subaccountName: 'default',
chainId: ink.id,
verifyingAddr: '0x...',
displayName: 'Alice.One',
});API Surface
Public Queries
getUsernameAvailability, getProfiles, getFollowers, getFollowing, getFeed,
getNotificationPreferences, getRegisteredWallet.
getProfiles is the only profile route: it batches up to 25 subaccounts, returns them in the requested order,
and carries follower totals (include.followCounts) and a follow summary (include.followSummary.viewAs) as
opt-in includes, so use it for a single subaccount too. The backend still serves the older singular profile
request for compatibility, but it returns base fields only and costs more weight than the batched equivalent,
so the SDK does not expose it.
getFollowers and getFollowing take an optional viewAs, which selects a viewer perspective rather than
proving one: with it the page is ordered familiar-first and every row carries an isFollowing, without it the
page is ordered by the listed relationship alone and isFollowing is absent rather than false. As with
include.followSummary.viewAs, an unsigned route means the claimed viewer is not verified.
Public Executes
unregisterExpoToken, updateNotificationPreferences. These are authenticated by possession of an active Expo
push token rather than a wallet signature, so they still work at logout when a signature may be unobtainable.
Signed Executes
setUsername, setPrivateMode, registerExpoToken, setFollow.
Linked Signers
The mobile client supports linked signers for delegated transaction signing:
mobile.setLinkedSigner(linkedSignerWalletClient);License
ISC
