API Documentation
Welcome to the Turing Wallet API documentation. The browser wallet API 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 setup and a complete DApp example.
Quick Start
ts
// Connect to wallet
const addresses = await Turing.connect();
console.log(addresses);
// => { tbcAddress, btcAddress, ethAddress, bnbAddress }
// Send a transaction
const { txid } = await Turing.sendTransaction([
{ flag: "P2PKH", address: "recipient_address", satoshis: 10000 },
]);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 |