Skip to main content

Overview

The @prudra/wallet package wraps Prudra HTTP APIs for both the legacy Tempo custodial wallet (/wallets) and managed infrastructure (/wallet-infra/*). Initialise @prudra/core once with your API key; all helpers reuse that configuration.

Setup

import { Chain, Token, initialise } from '@prudra/core';
import {
  provisionManagedWallet,
  transferManagedTokens,
  withdrawManagedFunds,
  registerBankAccount,
} from '@prudra/wallet';

initialise({ apiKey: process.env.PRUDRA_API_KEY! });

Constants (@prudra/core)

Chain and Token provide autocomplete-friendly slugs and symbols shared with the server.

Legacy Tempo wallet API

FunctionRoute
getWallet, provisionWallet/wallets/me, POST /wallets
getBalance, getHistorybalance + history
withdrawwithdrawal stub / future implementation
Use these for USDC-on-Tempo style flows that pre-date multi-chain masters.

Managed infrastructure

FunctionPurpose
provisionManagedWalletPOST /wallet-infra/master-wallets
listManagedWallets, getManagedMasterWalletList/get masters
deriveManagedChildAddress, listManagedChildAddressesHD children
getManagedWalletBalances, getManagedWalletTransactionsBalances + tx feed
transferManagedTokensPOST /wallet-infra/transfer
registerBankAccount, listBankAccounts, deleteBankAccountFiat metadata
withdrawManagedFunds, listManagedWithdrawals, getManagedWithdrawalWithdrawals

Transfer helper

Managed sends intentionally use the name transferManagedTokens to avoid clashing with Tempo withdraw helpers:
const out = await transferManagedTokens({
  fromWalletId: 'mwt_xxx',
  fromWalletType: 'master',
  fromChain: Chain.BASE,
  fromToken: Token.USDC,
  toAddress: '0x...',
  toChain: Chain.BASE,
  toToken: Token.USDC,
  amount: '25.00',
});