API Documentation
Welcome to the Turing Wallet API documentation. This SDK lets you integrate Turing Wallet into your DApp with support for TBC, BTC, Ethereum, and BSC chains.
New to Turing Wallet?
Start with the Getting Started Guide for a step-by-step walkthrough including installation, setup, and a complete DApp example.
Quick Start
ts
import { useTuringWallet } from "turing-wallet-provider";
const wallet = useTuringWallet();
// Connect to wallet
const addresses = await wallet.connect();
console.log(addresses);
// => { tbcAddress, btcAddress, ethAddress, bnbAddress }
// Send a transaction
const { txid } = await wallet.sendTransaction([
{ flag: "P2PKH", address: "recipient_address", satoshis: 10000 },
]);You can also use the
Turingglobal object:await Turing.connect(). See Getting Started for details on both patterns.
API Overview
Connection
| Method | Description |
|---|---|
| connect | Connect to wallet and get addresses |
| disconnect | Disconnect from wallet |
| isConnected | Check connection status |
Account Info
| Method | Description |
|---|---|
| getPubKey | Get public key |
| getAddress | Get wallet addresses |
| getInfo | Get wallet name, platform, version |
Signing & Encryption
| Method | Description |
|---|---|
| signMessage | Sign a message with encoding support |
| signTransaction | Sign raw transactions |
| signAssociatedTransaction | Sign parent-child transactions |
| encrypt | Encrypt data with wallet key |
| decrypt | Decrypt data with wallet key |
TBC Transactions
| Method | Description |
|---|---|
| sendTransaction | Send TBC transactions (P2PKH, NFT, FT, PoolNFT, Stablecoin) |
| sendBatchRequest | Batch multiple requests (up to 5) |
EVM Transactions
| Method | Description |
|---|---|
| evm.sendTransaction | Send Ethereum/BSC transactions (native + ERC20) |
BTC Transactions
| Method | Description |
|---|---|
| btc.sendTransaction | Send BTC transactions |
| btc.signTransaction | Sign BTC transactions (Legacy/SegWit/Taproot) |
| btc.sendBatchRequest | BTC batch requests |