Retrieve Transaction Data for Withdrawing from Safe
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"domain": {
"verifyingContract": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"chainId": 100
},
"primaryType": "ModuleTx",
"types": {
"ModuleTx": [
{
"type": "bytes",
"name": "data"
}
]
},
"message": {
"data": "0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000",
"salt": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
}
}{
"error": "Unauthorized"
}{
"error": "Couldn't find associated Safe for the user"
}{
"error": "amount must be a valid integer"
}{
"message": "An unexpected error occurred."
}Account Management
Retrieve Transaction Data for Withdrawing from Safe
Returns the EIP-712 typed data that needs to be signed by the user’s wallet to withdraw ERC20 tokens or native tokens (xDAI) from the user’s Safe account.
For ERC20 tokens, provide the token contract address. For native token (xDAI) withdrawals, use “0x0000000000000000000000000000000000000000” as the tokenAddress.
This endpoint is used as part of a three-step process:
- Call this endpoint to get the EIP-712 typed data
- Sign the typed data with the user’s wallet using EIP-712 signature standard
- Submit the signature to the POST
/api/v1/accounts/withdrawendpoint
GET
/
api
/
v1
/
accounts
/
withdraw
/
transaction-data
Retrieve Transaction Data for Withdrawing from Safe
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/accounts/withdraw/transaction-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"domain": {
"verifyingContract": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"chainId": 100
},
"primaryType": "ModuleTx",
"types": {
"ModuleTx": [
{
"type": "bytes",
"name": "data"
}
]
},
"message": {
"data": "0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000",
"salt": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
}
}{
"error": "Unauthorized"
}{
"error": "Couldn't find associated Safe for the user"
}{
"error": "amount must be a valid integer"
}{
"message": "An unexpected error occurred."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
The address of the token to withdraw. Use "0x0000000000000000000000000000000000000000" for native token (xDAI) withdrawals.
Pattern:
^0x[a-fA-F0-9]{40}$The address to withdraw to.
Pattern:
^0x[a-fA-F0-9]{40}$The amount to withdraw in the token's base units.
Pattern:
^[1-9][0-9]*$Response
Successfully retrieved EIP-712 typed data for signing.
Show child attributes
Show child attributes