Wallet routes
A wallet comprises a private key, a public key, and many addresses. To enable a user to accept tokens or digital assets, create a wallet for them using our API.
You can create one wallet per blockchain.
Here are routes for the profile management.
Create a wallet
This operation creates a wallet
POST
https://sandbox.oumla.com/api/v1/wallets/
generate
Headers
x-api-key*
string
The API key generated from Oumla's dashboard
Request body
reference *
string
Any identifer for this user this could be the UUID for the user or profile
network*
NetworkType
One of the network types that we support. like for example "ETH"
Sample code of the request:
async function generateWallet(reference: string, network: string) {
const apiKey = "Your API Key";
const url = "https://sandbox.oumla.com/api/v1/wallets/generate";
const data = JSON.stringify({ reference, network });
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
body: data,
});
const responseData = await response.json();
console.log(responseData);
}
// Example usage
generateWallet("dba1fea5-2004-4ea8-a06d-a7c7c5559b8f","BTC");
The expected response:
"data": {
"reference": "-2004-4ea8-a06d-a7c7c5559b8f",
"network": "ETH",
"type": "User",
"date": "2024-07-13T10:05:35.636Z"
},
Get Wallets
This operation to get wallets by organization
organization
GET
https://sandbox.oumla.com/api/v1/wallets/
organization
Headers
x-api-key*
string
Oumla api key
Sample code of the request:
async function getWallets() {
const apiKey = "Your API Key";
const url = "https://sandbox.oumla.com/api/v1/wallets/organizations";
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
});
const data = await response.json();
console.log(data);
}
getWallets();
The expected response:
{
"data": [
{
"reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
"organizationId": "8a9e86b8889e36b8-b175-4371-950e-d0e8a2b56c67",
"network": "ETH",
"type": "User",
"date": "2024-07-13T10:05:35.636Z",
"currentDeepIndex": 0,
"index": 1
},
{
"reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
"organizationId": "889e36b8-b175-4371-950e-d0e8a2b56c67",
"network": "BTC",
"type": "User",
"date": "2024-06-10T18:36:18.749Z",
"currentDeepIndex": 10,
"index": 0
},
// The other walllets
],
"pagination": {
"totalElements": 5,
"totalPages": 1,
"skip": 0,
"take": 10
},
"success": true,
"status": 200
}
This operation to get wallets by reference
reference
GET
https://sandbox.oumla.com/api/v1/wallets/
profile
/
{{reference}}
Query Parameters (required)
reference*
string
the id for that user.
Headers
x-api-key*
string
Oumla api key
Sample code of the request:
async function getWalletByReference(reference: string) {
const apiKey = "Your API Key";
const url = `https://sandbox.oumla.com/api/v1/wallets/profile/${reference}`;
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
});
const data = await response.json();
console.log(data);
}
getWalletByReference("89a625b9-4c5f-4130-8b56-afx8010f8103");
The expected response:
{
"data": [
{
"reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
"organizationId": "8a9e86b8889e36b8-b175-4371-950e-d0e8a2b56c67",
"network": "ETH",
"type": "User",
"date": "2024-07-13T10:05:35.636Z",
"currentDeepIndex": 0,
"index": 1
},
{
"reference": "89a625b9-4c5f-4130-8b56-afx8010f8103",
"organizationId": "889e36b8-b175-4371-950e-d0e8a2b56c67",
"network": "BTC",
"type": "User",
"date": "2024-06-10T18:36:18.749Z",
"currentDeepIndex": 10,
"index": 0
},
// The other walllets
],
"pagination": {
"totalElements": 5,
"totalPages": 1,
"skip": 0,
"take": 10
},
"success": true,
"status": 200
}
Last updated