Resimulation
curl --request POST \
--url https://api.mpcvault.com/v1/resimulation \
--header 'Content-Type: application/json' \
--header 'x-mtoken: <api-key>' \
--data '
{
"signingRequestUuid": "9f5ee5fb-07f5-470c-a2ff-081e2d6d107a"
}
'import requests
url = "https://api.mpcvault.com/v1/resimulation"
payload = { "signingRequestUuid": "9f5ee5fb-07f5-470c-a2ff-081e2d6d107a" }
headers = {
"x-mtoken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-mtoken': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signingRequestUuid: '9f5ee5fb-07f5-470c-a2ff-081e2d6d107a'})
};
fetch('https://api.mpcvault.com/v1/resimulation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mpcvault.com/v1/resimulation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'signingRequestUuid' => '9f5ee5fb-07f5-470c-a2ff-081e2d6d107a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-mtoken: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mpcvault.com/v1/resimulation"
payload := strings.NewReader("{\n \"signingRequestUuid\": \"9f5ee5fb-07f5-470c-a2ff-081e2d6d107a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-mtoken", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mpcvault.com/v1/resimulation")
.header("x-mtoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signingRequestUuid\": \"9f5ee5fb-07f5-470c-a2ff-081e2d6d107a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mpcvault.com/v1/resimulation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-mtoken"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signingRequestUuid\": \"9f5ee5fb-07f5-470c-a2ff-081e2d6d107a\"\n}"
response = http.request(request)
puts response.read_body{
"simulation": "aSDinaTvuI8gbWludGxpZnk=",
"error": {
"message": "<string>",
"executeSigningRequestsErrorCode": "EXECUTE_SIGNING_REQUESTS_ERROR_CODE_UNSPECIFIED",
"serviceErrorCode": "SERVICE_ERROR_CODE_UNSPECIFIED"
}
}Signing Requests
Resimulation
Re-run the simulation of a pending signing request.
POST
/
v1
/
resimulation
Resimulation
curl --request POST \
--url https://api.mpcvault.com/v1/resimulation \
--header 'Content-Type: application/json' \
--header 'x-mtoken: <api-key>' \
--data '
{
"signingRequestUuid": "9f5ee5fb-07f5-470c-a2ff-081e2d6d107a"
}
'import requests
url = "https://api.mpcvault.com/v1/resimulation"
payload = { "signingRequestUuid": "9f5ee5fb-07f5-470c-a2ff-081e2d6d107a" }
headers = {
"x-mtoken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-mtoken': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signingRequestUuid: '9f5ee5fb-07f5-470c-a2ff-081e2d6d107a'})
};
fetch('https://api.mpcvault.com/v1/resimulation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mpcvault.com/v1/resimulation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'signingRequestUuid' => '9f5ee5fb-07f5-470c-a2ff-081e2d6d107a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-mtoken: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mpcvault.com/v1/resimulation"
payload := strings.NewReader("{\n \"signingRequestUuid\": \"9f5ee5fb-07f5-470c-a2ff-081e2d6d107a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-mtoken", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mpcvault.com/v1/resimulation")
.header("x-mtoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signingRequestUuid\": \"9f5ee5fb-07f5-470c-a2ff-081e2d6d107a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mpcvault.com/v1/resimulation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-mtoken"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signingRequestUuid\": \"9f5ee5fb-07f5-470c-a2ff-081e2d6d107a\"\n}"
response = http.request(request)
puts response.read_body{
"simulation": "aSDinaTvuI8gbWludGxpZnk=",
"error": {
"message": "<string>",
"executeSigningRequestsErrorCode": "EXECUTE_SIGNING_REQUESTS_ERROR_CODE_UNSPECIFIED",
"serviceErrorCode": "SERVICE_ERROR_CODE_UNSPECIFIED"
}
}Re-runs the simulation of a pending signing request and returns the stored simulation. The encoding of
simulation is described under Simulation: base64 in JSON, decoding to UTF-8 JSON text in a network-specific form, for reference only.
A successful re-run replaces the stored simulation with the result of the run. If the simulation provider returns an error, or the organization’s simulation allowance is used up, the call still succeeds and simulation is empty. A simulation that does not finish within 5 seconds fails a custom transaction with an error, and returns the earlier stored simulation for a dApp transaction. A returned simulation therefore does not show that it was just re-run.
The request must be pending, belong to a vault the API token can access, and have been created by the same API user. Only custom transactions and EVM dApp transactions are simulated; for any other request simulation is empty.
| Failure | HTTP status | Message |
|---|---|---|
signingRequestUuid is empty | 400 (FailedPrecondition) | Signing request uuid required |
| The request does not exist, is in another organization or an inaccessible vault, or was created by another API user | 400 (InvalidArgument) | Invalid uuid |
| The request is not pending | 400 (FailedPrecondition) | Signing request already done |
Authorizations
Your API token. Required for all API requests.
Body
application/json
UUID of the signing request to be simulated. It must be pending and must have been created by the same API token.
Example:
"9f5ee5fb-07f5-470c-a2ff-081e2d6d107a"
Was this page helpful?