WalletsAPI
Access viaclient.wallets.
register
Register a wallet (idempotent — re-registering returns the existing wallet). Passproof to register it controlled.
async register(request: RegisterWalletRequest): Promise<WalletResponse>
interface RegisterWalletRequest {
/** Wallet address on the blockchain */
walletAddress: string;
/** Blockchain network */
blockchain: 'solana' | 'polygon' | 'ethereum' | 'base';
/** External user or account ID for multi-wallet management.
* Refused (USER_ID_NOT_ALLOWED) when your organization opens client accounts */
userId?: string;
/** The client account the wallet belongs to (see Accounts). Links the wallet and sets its
* userId to the account's reference. Only when your organization opens client accounts */
accountId?: number;
/** Organization-specific metadata */
orgMetadata?: Record<string, unknown>;
/** A signed challenge for this address (see challenge). Registers the wallet CONTROLLED */
proof?: WalletProof;
}
interface WalletProof {
challengeId: number;
/** Solana: base58 ed25519 signature. EVM: 0x hex personal_sign signature */
signature: string;
}
A register without
proof currently creates a LEGACY wallet, which operates normally. This is a deprecation window
that will end at a date to be announced. After it, a register without proof creates a WATCH_ONLY wallet that can’t
Supply, Unwind or Transfer Out until you call verify.challenge
Request a one-time ownership challenge for a wallet address. Signmessage with the wallet, then pass
{ challengeId, signature } to register({ proof }) or verify() before expiresAt.
async challenge(request: WalletChallengeRequest): Promise<WalletChallengeResponse>
interface WalletChallengeRequest {
walletAddress: string;
blockchain: 'solana' | 'polygon' | 'ethereum' | 'base';
}
interface WalletChallengeResponse {
challengeId: number;
/** The exact text to sign */
message: string;
/** ISO 8601 */
expiresAt: string;
}
verify
Prove control of a registered wallet. AWATCH_ONLY or LEGACY wallet becomes CONTROLLED.
async verify(walletId: number, proof: WalletProof): Promise<VerifyWalletResponse>
interface VerifyWalletResponse {
/** CONTROLLED: now controlled. UNCHANGED: already was. DISPUTED: another organization holds the
* address without proof; the wallet stays WATCH_ONLY while RebelFi reviews it */
outcome: 'CONTROLLED' | 'UNCHANGED' | 'DISPUTED';
wallet: WalletResponse;
}
import nacl from 'tweetnacl';
import bs58 from 'bs58';
const { challengeId, message } = await client.wallets.challenge({ walletAddress, blockchain: 'solana' });
const signature = bs58.encode(nacl.sign.detached(new TextEncoder().encode(message), keypair.secretKey));
const { outcome, wallet } = await client.wallets.verify(walletId, { challengeId, signature });
list
List wallets for the organization.async list(query?: WalletListQuery): Promise<WalletListResponse>
interface WalletListQuery {
/** Filter by external user ID */
userId?: string;
/** Filter by blockchain */
blockchain?: 'solana' | 'polygon' | 'ethereum' | 'base';
/** Page number (default: 1) */
page?: number;
/** Items per page (default: 50, max: 100) */
limit?: number;
}
interface WalletListResponse {
wallets: WalletResponse[];
total: number;
page: number;
limit: number;
}
get
Get a wallet by ID.async get(walletId: number): Promise<WalletResponse>
update
Update wallet metadata.async update(walletId: number, request: UpdateWalletRequest): Promise<WalletResponse>
interface UpdateWalletRequest {
/** External user ID. Refused (USER_ID_NOT_ALLOWED) when your organization opens client accounts */
userId?: string;
/** Organization-specific metadata */
orgMetadata?: Record<string, unknown>;
}
WalletResponse Type
Optional fields without a value (userId, accountId, orgMetadata) are left out of the response, never null.
interface WalletResponse {
/** Wallet identifier */
walletId: number;
/** Wallet address on the blockchain */
walletAddress: string;
/** Blockchain network */
blockchain: 'solana' | 'polygon' | 'ethereum' | 'base';
/** External user ID; for a wallet linked to a client account, the account's reference */
userId?: string;
/** The client account the wallet is linked to */
accountId?: number;
/** Organization-specific metadata */
orgMetadata?: Record<string, unknown>;
/** Creation timestamp (ISO 8601) */
createdAt: string;
/** Whether your organization controls the address */
control: WalletControl;
}
interface WalletControl {
/** CONTROLLED: proven. LEGACY: registered without proof, operates normally.
* WATCH_ONLY: balance only; operations fail with WALLET_NOT_VERIFIED */
status: 'CONTROLLED' | 'LEGACY' | 'WATCH_ONLY';
/** How control was established; null when WATCH_ONLY */
method: 'CUSTODY_CREATED' | 'SIGNED_CHALLENGE' | 'OPERATOR' | 'MIGRATION' | 'LEGACY_SDK' | null;
/** When control was proven (ISO 8601); absent unless proven */
provenAt?: string;
}