Wallet API
Wallet API is used to create and fetch wallets of the economy users. Wallet is a smart contract proxy wallet that is deployed on the Fuse network. It has an owner which is in charge of wallet, owner is controlling the wallet funds and can perform other various transactions by signing messages and sending them to the relayer. See Jobs API to learn about relaying.
Choosing a owner you are deciding on the custody on the funds. Fuse API provides two modes for this:
  • User is its own bank - native to crypto approach when the user holds the keys to his funds. As stated above, with the Fuse API the users holds the private key of the owner of the wallet.
  • Custody - Economy creator is the custodian of the funds. The wallet owner is an account generated by the Fuse Studio backend. It can be controlled by the economy creator via the Admin API. This is an easy way to start your economy and onboard users without the usual friction of a blockchain wallet.
It is also possible to mix the modes and migrate the users between the modes. For example a user can start with the custody mode and move to the crypto native mode once the economy manager is sure that users keys are stored in a secure way.

Create wallet contract for user

Creates wallet contract for the user
1
POST api/v2/wallets/
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Success 200

Name
Type
Description
Started
Object
job data

Create wallet contract for user on Ethereum

[Deprecated!] Creates wallet contract for the user on Ethereum
1
POST api/v2/wallets/foreign
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Success 200

Name
Type
Description
Started
Object
job data

Fetch all wallets by phone number

Fetches all wallets created by phone number
1
GET api/v2/wallets/all/:phoneNumber
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Success 200

Name
Type
Description
data
Object
Array of Wallet objects

Get token transfer events by address on fuse

Get token transfer events by address on fuse
1
GET api/v2/wallets/transfers/tokentx/:walletAddress
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Parameter Parameters

Name
Type
Description
tokenAddress
String
Address of the token
startblock
String
The block number to start fetch from

Success 200

Name
Type
Description
data
Object
Array of transfer events

Fetch user wallet

Fetches user's wallet address
1
GET api/v2/wallets/
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Success 200

Name
Type
Description
data
Object
User wallet object

Fetch latest wallet by phone number

Fetches latest wallet created by phone number
1
GET api/v2/wallets/:phoneNumber
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Success 200

Name
Type
Description
data
Object
Wallet object

Notify server on client wallet backup

Notify the server that the client has backed up his wallet
1
POST api/v2/wallets/backup
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Parameter Parameters

Name
Type
Description
communityAddress
String
community address

Success 200

Name
Type
Description
Started
Object
job data

Create wallet for phone number

Creates wallet contract for phone number, owned by the server until claimed by the user
1
POST api/v2/wallets/invite/:phoneNumber
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Parameter Parameters

Name
Type
Description
communityAddress
String
community address

Success 200

Name
Type
Description
Started
Object
job data

Check if wallet exists by wallet address

Checks if wallet exists by wallet address
1
GET api/v2/wallets/exists/:walletAddress
Copied!

Headers

Name
Type
Description
Authorization
String
JWT Authorization in a format "Bearer {jwtToken}"

Success 200

Name
Type
Description
data
Boolean
True if wallet exists, false otherwide

WalletLogin

Request a verification code

Request a verification code to user's phone number
1
POST api/v2/login/wallet/sms/request
Copied!

Parameter Parameters

Name
Type
Description
phoneNumber
String
User phone number

Success 200

Name
Type
Description
response
String
Response status - ok

Login using firebase ID token

Login using firebase ID token
1
POST api/v2/login/wallet/firebase/verify
Copied!

Parameter Parameters

Name
Type
Description
accountAddress
String
User account address
token
String
Firebase ID token
identifier
String
Phone device identifier
appName
String
firebase app name the user is connecting to. optional

Success 200

Name
Type
Description
token
String
JWT token

Verify user phone number

Verify user phone number by SMS verification code
1
POST api/v2/login/wallet/sms/verify
Copied!

Parameter Parameters

Name
Type
Description
phoneNumber
String
User phone number
accountAddress
String
User account address
code
String
SMS code recieved to user phone number

Success 200

Name
Type
Description
token
String
JWT token