Receive BTC Testnet Coins in SUBTC Wallet

permalink SUBTC
#btc#coins#receive#subtc#testnet

To fund your SUBTC testnet wallet, you first need a receiving address.<br>This command generates a new address for a specific wallet.

Generate a receive address:<br>command:<br>

KEY=SUBTC-KEY-c942534db29afa0a50957ef909c8ea4a4fb17bf5392b1682
WID=w_cf21a601a3f461a92699e5b5dac80ad6d9d66de4592d

RESP=$(curl -sS -X POST "https://api.subtc.net/v1/btc?mode=wallet_receive" \
  -H "X-SUBTC-KEY: $KEY" \
  -H "Content-Type: application/json" \
  -d "{\"wallet_id\":\"$WID\"}")
<br>Extract the address:

ADDR=$(echo "$RESP" | sed -n 's/.*"address":"\([^"]*\)".*/\1/p')<br>echo "ADDR=$ADDR"

Example output:

ADDR=tb1qj3xzdyr6fdhzh37w4avm4l5dnm53cmvf6p27rf

Next, send testnet BTC from a faucet (e.g., coinfaucet.eu) to this address.

Transaction example:

  • Amount: 0.00102324 BTC
  • Address: tb1qj3xzdyr6fdhzh37w4avm4l5dnm53cmvf6p27rf

- TXID: fc7b555eda7f9e29b5a7ce70fc9e4ad326bc6636ba85a5abd669c33af9016330
<br>Check wallet balance:

curl -sS -X POST "https://api.subtc.net/v1/btc?mode=wallet_balance" \<br>-H "X-SUBTC-KEY: $KEY" \<br>-H "Content-Type: application/json" \<br>-d "{\"wallet_id\":\"$WID\"}"

Example response:

{<br>"ok": true,<br>"request_id": "951d925d0503cdc1",<br>"result": {<br>"addresses": ["tb1qj3xzdyr6fdhzh37w4avm4l5dnm53cmvf6p27rf"],<br>"balance_sat": 102324,<br>"balance_source": "getbalances",<br>"coin": "btc",<br>"confirmed_sat": 0,<br>"immature_sat": 0,<br>"net": "test",<br>"unconfirmed_sat": 102324,<br>"wallet_id": "w_cf21a601a3f461a92699e5b5dac80ad6d9d66de4592d"<br>}<br>}

What happened:

The wallet received 0.00102324 BTC (102,324 satoshis) on testnet.<br>The balance is currently unconfirmed until the transaction is mined.

API Base:<br>https://subtc.net/api