/approveMpcRequestForSwagger
1 min
POST
http://1.1.1.1/approveMpcRequestForSwagger
Query Parameters
- request_idstringrequiredExampleDescriptionDefault9e2626a39663f285fdfae2fc0b329baf
- request_creator_idstringrequiredExampleDescriptionDefault9e2626a39663f285fdfae2fc0b329baf
- request_creator_namestringExampleDescriptionDefaultMatthew
- request_typeintegerDescriptionDefault0
- coin_typestringrequiredExampleDescriptionDefaultBTC
- account_idintegerrequiredExampleDescriptionDefault1
- outputsarray[]requiredExample
[ "100000000", "36t2WWRbzuw8Ft5o8GXBUzCc3ZEF84eMjm" ]
DescriptionDefault100000000,36t2WWRbzuw8Ft5o8GXBUzCc3ZEF84eMjm - tx_access_tokenstringrequiredExampleDescriptionDefaulta8c2b4da17998863be8c6270e65be24dec8e79eaea616a54a89184ec43379021
- approvers_liststring[]requiredExample
[ "3", "[email protected]" ]
DescriptionDefault - specific_from_addressstringrequiredExampleDescriptionDefault3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3
- max_priority_feeintegerExampleDescriptionDefault1000000
- gas_limitintegerExampleDescriptionDefault21000
- storage_limitintegerExampleDescriptionDefault257
- is_eth1_to_eth2_conversionbooleanExampleDescriptionDefaultfalse
- data_to_sign_and_data_for_contract_and_bytes_to_sign_and_feeobjectDescriptionDefault{ "please_insert_your_object_data_inside_the_requestBody": "your_object_here" }
Body Parameters
- bodyapproveMpcRequestForSwaggerRequest
- data_to_signstringExampleDefault0x67c1410ba1863095768ffe50b286360a744ff66d893379b027b8339f58ca525d
- bytes_to_signstringExampleDefault233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859
- data_for_contractstringExampleDefaultMyFunction
Responses
200
- approveMpcRequestForSwaggerResponse
- FunctionDataobject
- StatusstringExampleDescriptionDefaultsuccess
- MetaMetaResponse
- AccessTokenstringExampleDescriptionDefaulta3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6
- DestinationstringExampleDescriptionDefault042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622
- SourcestringExampleDescriptionDefaultdf4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355
- TimestringExampleDescriptionDefault2021-02-14 09:58:52.320
curl
curl --request POST \
--url 'http://1.1.1.1/approveMpcRequestForSwagger?request_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_name=Matthew&request_type=integer&coin_type=BTC&account_id=1&outputs=100000000%2C36t2WWRbzuw8Ft5o8GXBUzCc3ZEF84eMjm&tx_access_token=a8c2b4da17998863be8c6270e65be24dec8e79eaea616a54a89184ec43379021&approvers_list=3%2Calice%40gk8.io&specific_from_address=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3&max_priority_fee=1000000&gas_limit=21000&storage_limit=257&is_eth1_to_eth2_conversion=false&data_to_sign_and_data_for_contract_and_bytes_to_sign_and_fee=%22{%5Cn%20%20%5C%22please_insert_your_object_data_inside_the_requestBody%5C%22%3A%20%5C%22your_object_here%5C%22%5Cn}%20%5Cn%22' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"data_to_sign": "0x67c1410ba1863095768ffe50b286360a744ff66d893379b027b8339f58ca525d",
"bytes_to_sign": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859",
"data_for_contract": "MyFunction"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"data_to_sign": "0x67c1410ba1863095768ffe50b286360a744ff66d893379b027b8339f58ca525d",
"bytes_to_sign": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859",
"data_for_contract": "MyFunction"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("http://1.1.1.1/approveMpcRequestForSwagger?request_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_name=Matthew&request_type=integer&coin_type=BTC&account_id=1&outputs=100000000,36t2WWRbzuw8Ft5o8GXBUzCc3ZEF84eMjm&tx_access_token=a8c2b4da17998863be8c6270e65be24dec8e79eaea616a54a89184ec43379021&approvers_list=3,[email protected]&specific_from_address=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3&max_priority_fee=1000000&gas_limit=21000&storage_limit=257&is_eth1_to_eth2_conversion=false&data_to_sign_and_data_for_contract_and_bytes_to_sign_and_fee=\"{\\n \\\"please_insert_your_object_data_inside_the_requestBody\\\": \\\"your_object_here\\\"\\n} \\n\"", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("http://1.1.1.1/approveMpcRequestForSwagger?request_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_name=Matthew&request_type=integer&coin_type=BTC&account_id=1&outputs=100000000,36t2WWRbzuw8Ft5o8GXBUzCc3ZEF84eMjm&tx_access_token=a8c2b4da17998863be8c6270e65be24dec8e79eaea616a54a89184ec43379021&approvers_list=3,[email protected]&specific_from_address=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3&max_priority_fee=1000000&gas_limit=21000&storage_limit=257&is_eth1_to_eth2_conversion=false&data_to_sign_and_data_for_contract_and_bytes_to_sign_and_fee=\"{\n \\"please_insert_your_object_data_inside_the_requestBody\\": \\"your_object_here\\"\n} \n\"")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"data_to_sign": "0x67c1410ba1863095768ffe50b286360a744ff66d893379b027b8339f58ca525d",
"bytes_to_sign": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859",
"data_for_contract": "MyFunction"
})
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "http://1.1.1.1/approveMpcRequestForSwagger?request_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_id=9e2626a39663f285fdfae2fc0b329baf&request_creator_name=Matthew&request_type=integer&coin_type=BTC&account_id=1&outputs=100000000,36t2WWRbzuw8Ft5o8GXBUzCc3ZEF84eMjm&tx_access_token=a8c2b4da17998863be8c6270e65be24dec8e79eaea616a54a89184ec43379021&approvers_list=3,[email protected]&specific_from_address=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3&max_priority_fee=1000000&gas_limit=21000&storage_limit=257&is_eth1_to_eth2_conversion=false&data_to_sign_and_data_for_contract_and_bytes_to_sign_and_fee=\"{\\n \\\"please_insert_your_object_data_inside_the_requestBody\\\": \\\"your_object_here\\\"\\n} \\n\""
payload = json.dumps({
"data_to_sign": "0x67c1410ba1863095768ffe50b286360a744ff66d893379b027b8339f58ca525d",
"bytes_to_sign": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859",
"data_for_contract": "MyFunction"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// success
{
"FunctionData": {
"Status": "success"
},
"Meta": {
"AccessToken": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
"Destination": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
"Source": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
"Time": "2021-02-14 09:58:52.320"
}
}- return - regular response if succeed else error