Skip to main content

Wallet

Get Wallet list

Retrieves all wallet records for an organization from the database.

GET

API_URL/api/wallet/wallet?type=1

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

Params

NameInputRequiredDescription
type1 or 2No1 = organisation
2 = end_user
Sample result
{
"status": 200,
"result": [
{
"wallet_type": "organisation",
"address": "0x44Ce5799F1d0672e657...",
"id": 5493,
"name": "Wallet 1",
"is_active": 1
},
{
"wallet_type": "end_user",
"address": "0x77eAFD1BbDB0dF4d...",
"id": 6416,
"name": "Wallet 2",
"is_active": 1
}
],
"pagination": {
"current_page": 1,
"first_page_url": "https://service-testnet.maschain.com/api/wallet/wallet?page=1",
"last_page": 5,
"last_page_url": "https://service-testnet.maschain.com/api/wallet/wallet?page=5",
"next_page_url": "https://service-testnet.maschain.com/api/wallet/wallet?page=2",
"per_page": 20,
"prev_page_url": null,
"total": 95
}
}

Get Wallet by address

Retrieves a specific wallet record by its ID from the database.

GET

API_URL/api/wallet/wallet/{address}

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

Sample result
{
"status": 200,
"result": {
"id": 6416,
"address": "0x77eAFD1BbDB0dF4d1A...",
"entity_id": null,
"name": "Wallet 1",
"is_active": 1,
"wallet_type": "end_user"
}
}

Create Organisation Wallet

Creates an wallet by organisation id and storing it in MasChain.

POST

API_URL/api/wallet/wallet

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

BODY

NameTypeRequired
namestringyes
wallet_category_idarrayNo
entity_idintNo
entity_category_idintNo
Sample request
{
"name":"Wallet Test"
}
Sample result
{
"status": 200,
"result": {
"id": 13239,
"address": "0x550BD3D7363bd0Fea7...",
"name": "Wallet Test",
"wallet_type": "organisation",
"is_active": 1,
"entity_id": null,
"entity_category_id": null
}
}

Create User Wallet

Creates a User and storing it in MasChain.

POST

API_URL/api/wallet/create-user

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

BODY

NameTypeRequired
namestringYes
emailstringYes
icstringYes
wallet_namestringNo
phonestringNo
entity_idintNo
entity_category_idintNo
Sample request
{
"name":"User 1",
"email":"test@email.com",
"ic":"IC Number 123"
}
Sample result
{
"status": 200,
"result": {
"wallet": {
"wallet_id": 13240,
"wallet_name": "User 1",
"wallet_address": "0x815D5e471395db1...",
"wallet_type": "user",
"is_active": 1,
"entity_id": null,
"entity_category_id": null
}
}
}

Update Wallet by address

Update wallet by address and store to db.

PUT

API_URL/api/wallet/wallet/{address}

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

BODY

NameTypeRequired
entity_idintno
namestringno
Sample request
{
"entity_id" : 1,
"name":"Update name"
}
Sample result
{
"status": 200,
"result": {
"id": 13240,
"address": "0x815D5e471395db1779...",
"entity_id": 1,
"name": "Update name",
"is_active": 1,
"wallet_type": "end_user"
}
}

Activate Wallet by address

Activate wallet by address.

PUT

API_URL/api/wallet/wallet/{address}/activate

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

Sample result
{
"status": 200,
"result": {
"id": 13240,
"address": "0x815D5e471395db177...",
"entity_id": 1,
"name": "Update name",
"is_active": 1,
"wallet_type": "end_user"
}
}

Deactivate Wallet by address

Deactivate wallet by address.

PUT

API_URL/api/wallet/wallet/{address}/deactivate

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

Sample result
{
"status": 200,
"result": {
"id": 13240,
"address": "0x815D5e471395db1779c...",
"entity_id": 1,
"name": "Update name",
"is_active": 0,
"wallet_type": "end_user"
}
}

Get Wallet Transaction Count

Retrieves the number of transaction initiated by a wallet address including pending transactions

GET

API_URL/api/wallet/wallet/{address}/transactions-count

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

content-type   application/json

Params

Use this endpoint to get the nonce for next transaction to execute. When use it as nonce, please query with block = "pending"
Default block values : "pending"
Supported block values: "earliest", "latest", "pending", "safe", "finalized"
Sample result
{
"status": 200,
"result": {
"wallet_address" : "0x147f20.....",
"block_type" : "pending"
"transaction_count" : 1
}
}