cURL
curl --request POST \
--url https://api.example.com/schedule-withdraw \
--header 'Content-Type: application/json' \
--data '
{
"userAddress": "<string>",
"amountUusdc": "1000000",
"signature": "<string>",
"expiry": 123
}
'import requests
url = "https://api.example.com/schedule-withdraw"
payload = {
"userAddress": "<string>",
"amountUusdc": "1000000",
"signature": "<string>",
"expiry": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userAddress: '<string>',
amountUusdc: '1000000',
signature: '<string>',
expiry: 123
})
};
fetch('https://api.example.com/schedule-withdraw', 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.example.com/schedule-withdraw",
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([
'userAddress' => '<string>',
'amountUusdc' => '1000000',
'signature' => '<string>',
'expiry' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/schedule-withdraw"
payload := strings.NewReader("{\n \"userAddress\": \"<string>\",\n \"amountUusdc\": \"1000000\",\n \"signature\": \"<string>\",\n \"expiry\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/schedule-withdraw")
.header("Content-Type", "application/json")
.body("{\n \"userAddress\": \"<string>\",\n \"amountUusdc\": \"1000000\",\n \"signature\": \"<string>\",\n \"expiry\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/schedule-withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userAddress\": \"<string>\",\n \"amountUusdc\": \"1000000\",\n \"signature\": \"<string>\",\n \"expiry\": 123\n}"
response = http.request(request)
puts response.read_body{
"withdrawId": "<string>",
"amountUusdc": "<string>",
"status": "pending",
"scheduledAt": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Account
Schedule Withdraw
POST
/
schedule-withdraw
cURL
curl --request POST \
--url https://api.example.com/schedule-withdraw \
--header 'Content-Type: application/json' \
--data '
{
"userAddress": "<string>",
"amountUusdc": "1000000",
"signature": "<string>",
"expiry": 123
}
'import requests
url = "https://api.example.com/schedule-withdraw"
payload = {
"userAddress": "<string>",
"amountUusdc": "1000000",
"signature": "<string>",
"expiry": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
userAddress: '<string>',
amountUusdc: '1000000',
signature: '<string>',
expiry: 123
})
};
fetch('https://api.example.com/schedule-withdraw', 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.example.com/schedule-withdraw",
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([
'userAddress' => '<string>',
'amountUusdc' => '1000000',
'signature' => '<string>',
'expiry' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/schedule-withdraw"
payload := strings.NewReader("{\n \"userAddress\": \"<string>\",\n \"amountUusdc\": \"1000000\",\n \"signature\": \"<string>\",\n \"expiry\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/schedule-withdraw")
.header("Content-Type", "application/json")
.body("{\n \"userAddress\": \"<string>\",\n \"amountUusdc\": \"1000000\",\n \"signature\": \"<string>\",\n \"expiry\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/schedule-withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"userAddress\": \"<string>\",\n \"amountUusdc\": \"1000000\",\n \"signature\": \"<string>\",\n \"expiry\": 123\n}"
response = http.request(request)
puts response.read_body{
"withdrawId": "<string>",
"amountUusdc": "<string>",
"status": "pending",
"scheduledAt": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Overview
Schedule a USDC withdrawal request. This is step 1 of the two-phase withdrawal process. Scheduling requires only a signature (no gas). The withdrawal will be processed and become claimable after system batching.To avoid ambiguity, we denote the smallest possible multiple of USDC (0.000001 USDC) as one
uusdc,
which stands for µUSDC (micro-USDC), and denote the smallest possible multiple of a contract (0.01 contract)
as one ccontract (centicontract).User-facing USDC balances are specified as fixed-point strings (e.g. "1.2625" for USDC). Contract quantities
in the API and SDK are specified as integer ccontracts strings (e.g. "1050" for 10.50 contracts at precision 2).Withdrawal Flow
Bison uses a two-phase withdrawal process:- Schedule (this endpoint): User signs a message to request a withdrawal for a specific amount
- Claim (
/get-withdraw-authorization+ on-chain tx): User gets authorization and executes the withdrawal on-chain
Request Body
Amount to withdraw in µUSDC as an integer string. Must be positive and not exceed deposited balance.
Unix timestamp when the signature expires. Should be set to ~10 minutes in the future.
Response
Withdrawal Status Flow
Withdrawals progress through these statuses:- pending: Scheduled, waiting for system processing
- fill-locked: Being processed by the system
- unclaimed: Ready to claim on-chain
- claimed: Successfully withdrawn
Error Responses
Returned when the withdrawal amount exceeds available balance.
{
"error": "Insufficient balance for withdrawal"
}
EIP-712 Signature
The signature must be generated using EIP-712 typed data with the following structure:const domain = {
name: 'BisonScheduleWithdraw',
version: '1',
chainId: 8453, // Base mainnet
};
const types = {
ScheduleWithdraw: [
{ name: 'userAddress', type: 'address' },
{ name: 'amountUusdc', type: 'uint256' },
{ name: 'expiry', type: 'uint256' },
],
};
const message = {
userAddress: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
amountUusdc: BigInt(50_000_000), // 50 USDC
expiry: BigInt(Math.floor(Date.now() / 1000) + 600), // 10 minutes
};
Example Request
{
"chain": "base",
"userAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"amountUusdc": 50000000,
"signature": "0x1234567890abcdef...",
"expiry": 1699565430
}
Example Response
{
"withdrawId": "550e8400-e29b-41d4-a716-446655440000",
"amountUusdc": 50000000,
"status": "pending",
"scheduledAt": "2024-11-09T15:30:00.000Z"
}
Important Notes
- No gas is required to schedule a withdrawal
- Withdrawal amount is deducted from deposited balance immediately
- Multiple withdrawals can be scheduled and will be batched when claiming
- Signature expires after the specified
expirytimestamp - Use
/pending-withdraws/{userAddress}to check withdrawal status
Body
application/json