forked from skill-mind/FortiChain-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-api.http
More file actions
112 lines (88 loc) · 2.91 KB
/
test-api.http
File metadata and controls
112 lines (88 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
### Variables
@baseUrl = http://localhost:3000
@walletId = 753fc540-1d86-4587-978f-9e15199d8d46
@ethereumAddress = 0xabcdef1234567890abcdef1234567890abcdef12
@starknetAddress = 0x057d35a858fc7a5238b9339d640648bb2363cddd729deb357d035d6f27c2d476
@stellarAddress = GAKONCKYJ7PRRKBZSWVPG3MURUNX4TLNWCAVTPXXGQDKB6BZD5RFA6AN
### Test the root endpoint
GET {{baseUrl}}/
Content-Type: application/json
### Get all wallets
GET {{baseUrl}}/api/wallets
Content-Type: application/json
### Create a new wallet - Ethereum address
POST {{baseUrl}}/api/wallets
Content-Type: application/json
{
"address": "{{ethereumAddress}}",
"role": "researcher"
}
### Create a new wallet - Starknet address
POST {{baseUrl}}/api/wallets
Content-Type: application/json
{
"address": "{{starknetAddress}}",
"role": "project_owner"
}
### Create a new wallet - Stellar address
POST {{baseUrl}}/api/wallets
Content-Type: application/json
{
"address": "{{stellarAddress}}",
"role": "validator"
}
### Test invalid wallet address
POST {{baseUrl}}/api/wallets
Content-Type: application/json
{
"address": "invalid-address",
"role": "researcher"
}
### Test invalid role
POST {{baseUrl}}/api/wallets
Content-Type: application/json
{
"address": "{{ethereumAddress}}",
"role": "invalid_role"
}
### Get wallet by ID (replace with actual ID after creating)
# Update @walletId above with the ID from a created wallet
GET {{baseUrl}}/api/wallets/id/{{walletId}}
Content-Type: application/json
### Get wallet by Ethereum address
GET {{baseUrl}}/api/wallets/address/{{ethereumAddress}}
Content-Type: application/json
### Get wallet by Starknet address
GET {{baseUrl}}/api/wallets/address/{{starknetAddress}}
Content-Type: application/json
### Get wallet by Stellar address
GET {{baseUrl}}/api/wallets/address/{{stellarAddress}}
Content-Type: application/json
### Update wallet (replace with actual ID after creating)
# Update @walletId above with the ID from a created wallet
PUT {{baseUrl}}/api/wallets/{{walletId}}
Content-Type: application/json
{
"address": "{{ethereumAddress}}",
"role": "validator"
}
### Delete wallet (replace with actual ID after creating)
# Update @walletId above with the ID from a created wallet
DELETE {{baseUrl}}/api/wallets/{{walletId}}
Content-Type: application/json
### Test error handling - Get non-existent wallet by ID
GET {{baseUrl}}/api/wallets/id/11111111-1111-1111-1111-111111111111
Content-Type: application/json
### Test error handling - Get non-existent wallet by address
GET {{baseUrl}}/api/wallets/address/0x1111111111111111111111111111111111111111
Content-Type: application/json
### Test error handling - Update non-existent wallet
PUT {{baseUrl}}/api/wallets/11111111-1111-1111-1111-111111111111
Content-Type: application/json
{
"address": "{{ethereumAddress}}",
"role": "validator"
}
### Test error handling - Delete non-existent wallet
DELETE {{baseUrl}}/api/wallets/11111111-1111-1111-1111-111111111111
Content-Type: application/json