Skip to content

Commit

Permalink
chore: updated bruno collection
Browse files Browse the repository at this point in the history
Also added post scripts to request to automatically update env variables after each call
  • Loading branch information
onmax committed Jun 18, 2024
1 parent 4c44c9c commit 7b25adf
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bruno_collection/Clear HTLC (sandbox only).bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{API_URL}}/{{provider}}/clear/H4ZYN2JYLLCLUZB5DCTTUKOPK
url: {{API_URL}}/v1/{{provider}}/clear/H4ZYN2JYLLCLUZB5DCTTUKOPK
body: none
auth: none
}
4 changes: 2 additions & 2 deletions bruno_collection/Create HTLC.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{API_URL}}/htlc
url: {{API_URL}}/v1/htlc
body: json
auth: none
}
Expand All @@ -26,7 +26,7 @@ body:json {
"preimage": {
"size": 32
},
"expires": "2024-04-20T18:00:00.000Z",
"expires": "2024-06-18T18:00:00.000Z",
"includeFee": false
}
}
2 changes: 1 addition & 1 deletion bruno_collection/Get HTLC.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

get {
url: {{API_URL}}/htlc/H4ZYN2JYLLCLUZB5DCTTUKOPK
url: {{API_URL}}/v1/htlc/H4ZYN2JYLLCLUZB5DCTTUKOPK
body: none
auth: none
}
17 changes: 17 additions & 0 deletions bruno_collection/Send SMS.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
meta {
name: Send SMS
type: http
seq: 6
}

get {
url: {{API_URL}}/sms/send/{{phone_number}}
body: none
auth: none
}

script:post-response {
let data = res.getBody();
bru.setEnvVar("hmac",data.hmac);
bru.setEnvVar("timestamp",data.timestamp);
}
2 changes: 1 addition & 1 deletion bruno_collection/Settle HTLC.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta {
}

post {
url: {{API_URL}}/htlc/H4ZYN2JYLLCLUZB5DCTTUKOPK/settle
url: {{API_URL}}/v1/htlc/H4ZYN2JYLLCLUZB5DCTTUKOPK/settle
body: json
auth: none
}
Expand Down
28 changes: 28 additions & 0 deletions bruno_collection/Verify SMS.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
meta {
name: Verify SMS
type: http
seq: 7
}

post {
url: {{API_URL}}/sms/verify
body: json
auth: none
}

body:json {
{
"phone_number": "{{phone_number}}",
"otp": "943704",
"verification_id": {
"timestamp": {{timestamp}},
"hmac": "{{hmac}}"
}
}
}

script:post-response {
let data = res.getBody();
bru.setEnvVar("smsApiToken",data.token);

}
6 changes: 5 additions & 1 deletion bruno_collection/environments/SINPE Movil Sandbox.bru
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
vars {
API_URL: https://sinpemovil.sandbox.nimiqoasis.com/v1
API_URL: https://sinpemovil.sandbox.nimiqoasis.com
provider: sinpemovil
phone_number: +50688888888
hmac: empty
timestamp: 00
smsApiToken: empty
}

0 comments on commit 7b25adf

Please sign in to comment.