Ask Siri to buy some bitcoin for you
This tutorial will help you setup your own system that lets you buy Bitcoin with a hands-free experience.
Prerequisites
- Vercel account
- Zebpay Developer account
- Shortcuts app
1. Create your Zebpay Application
- Visit Zebpay Developer Portal
- Sign-in & create your application (any app type would work)
- Once submitted & approved, go to GenerateToken tab
- Make sure
trade:read
&trade:create
are checked - Click on Generate Token
- Copy your
client_id
&token.access_token
2. Deploy your instance
You will need to keep following values handy;
APP_PASSCODE
: Use a strong passcodeopenssl rand -base64 32
APP_MAX_AMOUNT
: Max amount that can be bought by this application at onceZEBPAY_CLIENT_ID
: Your Zebpay applicationclient_id
ZEBPAY_ACCESS_TOKEN
: Your Zebpay applicationtoken.access_token
Time to deploy your instance 🚀
3. Create your Siri shortcut
There are two ways to do this.
Create you shortcut manually
- Open Shortcuts app
- Tap on + icon on top right corner
- Tap on + icon on the screen to add actions
- Search for Ask for Input action & add it
- Change input type from
Text
toNumber
- Edit prompt to
For how much?
- Search for Get Contents of URL action & add it
- Set your buy function URL
- Click on Show More
- Change method to
POST
- Click on Headers & then Add new header
- Set Key to
X-Passcode
& value to yourAPP_PASSCODE
- Change Request Body to
Form
- Click on Add new field & select
Text
- Set Key to
amount
- Click on the value field, and select
Provided Input
- Search for Show Result action & add it
- Name your shortcut
Buy Bitcoin
Create your shortcut using link
- Open Settings app
- Open Shortcuts settings
- Toggle on Allow Untrusted Shortcuts
- Open Buy Bitcoin shortcut on your device
Similarly, you can also setup a shortcut to schedule your bitcoin purchase using events in Shortcuts app.