Personal finance management
Consolidated finance of your users
A major challenge comes with the abundance of financial products like bank and savings accounts, exchanges (CEX, DEX and TradiFi) and NFT marketplaces. Users have multiple accounts and wallets everywhere, for both fiat currency and crypto. This issue calls for consolidation of accounts. A single Blockmate API is an excellent solution for that. It allows you to connect with all your users' crypto accounts and fetch all their financial data consolidated and in a standardized format. And, if you're starting from scratch, but looking for ways to improve your existing TradiFi business, we will help you unify crypto with fiats too. This is how you can provide a complete financial overview of their entire digital assets portfolio.
Blockmate’s solutions
One of the most demanded features in the financial industry is a comprehensive financial overview of all types of currencies and digital assets through a single UI. Be it a Super-app, a seamless omni-wallet platform or the next-gen money management app, either way with Blockmate’s API you can get the power of precise tracking of users wallets and transactions.
Personal Finance app
Single view of user financials across multiple providers and wallets
Unified financial data is what users of crypto and fiat need today. Blockmate’s API will give your users access to all their accounts in one place - aggregated, unified, and ready to use. With this solution your app will quickly become the bread and butter of crypto heads and individuals who have wallets and accounts in multiple financial institutions.
Enable in-app balance checks
Our API provides your users with the balance inquiry function allowing them to see current balances on their linked accounts. This means they will no longer need to switch between FinTech apps, instead they will fully emerge into your platform, powered by Blockmate.
Savings and investment recommendations
We scan up to 24 months of clean and categorized transaction history, to help your users improve their financial health and understand their expenditures. Investment accounts, including account balances, holdings, and transactions - we analyze, aggregate, and standardize data for you. Taken all this, you can promise your users to help them eliminate wasteful spendings and guide them towards smarter investments and savings.
Sample app demo code
Total balance in crypto and USD
"balance": {
"balance_sum": [
{
"currency": "BTC",
"value": 12.2,
"converted_currency": "EUR",
"converted_value": 3.14
}
],
"accounts": [
...
]
}
List of all transactions ordered by date
{
"account_id": "abcd",
"transaction_id": "1234",
"amount": [
{
"currency": "BTC",
"value": 0.00005,
"converted_currency": "USD",
"converted_value": 0.20499224609375002
}
],
"total": [
{
"currency": "BTC",
"value": 0.00111,
"converted_currency": "USD",
"converted_value": 22.754139316406253
}
],
"fee": [
{
"currency": "BTC",
"value": 0.00017700000000000007,
"converted_currency": "USD",
"converted_value": 3.6283627558593765
}
],
"created_at": "2022-07-14T12:58:21Z",
"inputs": [
{
"address": "bc11...",
"amount": {
"currency": "BTC",
"value": 0.00111,
"converted_currency": "USD",
"converted_value": 22.754139316406253
},
"owned": false,
"fee": false
}
],
"outputs": [
{
"address": "bc12...",
"amount": {
"currency": "BTC",
"value": 1e-05,
"converted_currency": "USD",
"converted_value": 0.20499224609375002
},
"owned": true,
"fee": false
},
{
"address": "bc13...",
"amount": {
"currency": "BTC",
"value": 0.000923,
"converted_currency": "USD",
"converted_value": 18.920784314453126
},
"owned": false,
"fee": false
},
{
"address": "",
"amount": {
"currency": "BTC",
"value": 0.00017700000000000007,
"converted_currency": "USD",
"converted_value": 3.6283627558593765
},
"owned": false,
"fee": true
}
]
},
{
...
},
{
...
}
Prerequisites
Before we dive into the description and code, below are some prerequisites you will need:
- Install python3 - 'Windows/Linux/Mac tutorials'
- Install required library
pip3 install requests
- Paste your token (received by email, or register HERE ) into
my_project_token
variable - Run following python script:
python3 ./blockmate-personal-finance.py
Connect multiple accounts and get balance and transactions
#!/usr/bin/python3
import requests
import json
import time
import sys
# Fill in your token there
my_project_token="paste_your_token_here"
# Create a user
r = requests.post("https://api.blockmate.io/v1/users", json={"name": "test-user"}, headers={"X-API-KEY": my_project_token})
user_uuid = r.json()["uuid"]
print(f"We got user with id: {user_uuid}")
# Authenticate the user
r = requests.get(f"https://api.blockmate.io/v1/users/{user_uuid}/auth", headers={"X-API-KEY": my_project_token})
user_jwt_token = r.json()["token"]
print(f"We got JWT token for the user")
# Connect a BTC wallet (account) to user
r = requests.post("https://api.blockmate.io/v1/onchain/btc/connect", json={"description": "My test btc address", "wallet": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"}, headers={"Authorization": f"Bearer {user_jwt_token}"})
account_id = r.json()["id"]
print(f"We connected an account to user with id: {account_id}")
# Sync BTC account
while True:
r = requests.get(f"https://api.blockmate.io/v1/onchain/btc/account/{account_id}/balance", headers={"Authorization": f"Bearer {user_jwt_token}"})
balance = r.json()
sys.stdout.write(".")
sys.stdout.flush()
if balance["state"]["last_sync"] is not None: break
time.sleep(1)
print()
print("=== BTC Account Balance ===")
print(balance["balance"])
# Connect ETH wallet (account) to user
r = requests.post("https://api.blockmate.io/v1/onchain/eth/connect", json={"description": "My test eth address", "wallet": "0x00daa9a2d88bed5a29a6ca93e0b7d860cd1d403f"}, headers={"Authorization": f"Bearer {user_jwt_token}"})
account_id = r.json()["id"]
print(f"We connected an account to user with id: {account_id}")
#Syc ETH account
while True:
r = requests.get(f"https://api.blockmate.io/v1/onchain/eth/account/{account_id}/balance", headers={"Authorization": f"Bearer {user_jwt_token}"})
balance = r.json()
sys.stdout.write(".")
sys.stdout.flush()
if balance["state"]["last_sync"] is not None: break
time.sleep(1)
print()
print("=== ETH Account Balance ===")
print(balance["balance"])
# Get the TOTAL balance, when it's ready with USD values
r = requests.get(f"https://api.blockmate.io/v1/aggregate/balance?currency=USD", headers={"Authorization": f"Bearer {user_jwt_token}"})
balance = r.json()
print("=== Total Balance (All accounts) ===")
print(balance["balance_sum"])
# Get the transactions with USD values and since day limit
r = requests.get(f"https://api.blockmate.io/v1/aggregate/transactions?currency=USD&since=2022-07-01", headers={"Authorization": f"Bearer {user_jwt_token}"})
transactions = r.json()
print("=== Transactions ===")
print(json.dumps(transactions["transactions"], indent=4))
Updated about 2 years ago