Create a wallet
curl --request POST \
--url https://harness.chance.cc/api/v1/wallets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "trading",
"chain": "base",
"mode": "safe",
"mandate": "Swaps between USDC and WETH only. Never send funds to a new address.",
"limits": {
"maxPerTxUsd": 200,
"dailyCapUsd": 500
}
}
'import requests
url = "https://harness.chance.cc/api/v1/wallets"
payload = {
"name": "trading",
"chain": "base",
"mode": "safe",
"mandate": "Swaps between USDC and WETH only. Never send funds to a new address.",
"limits": {
"maxPerTxUsd": 200,
"dailyCapUsd": 500
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'trading',
chain: 'base',
mode: 'safe',
mandate: 'Swaps between USDC and WETH only. Never send funds to a new address.',
limits: {maxPerTxUsd: 200, dailyCapUsd: 500}
})
};
fetch('https://harness.chance.cc/api/v1/wallets', 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://harness.chance.cc/api/v1/wallets",
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([
'name' => 'trading',
'chain' => 'base',
'mode' => 'safe',
'mandate' => 'Swaps between USDC and WETH only. Never send funds to a new address.',
'limits' => [
'maxPerTxUsd' => 200,
'dailyCapUsd' => 500
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://harness.chance.cc/api/v1/wallets"
payload := strings.NewReader("{\n \"name\": \"trading\",\n \"chain\": \"base\",\n \"mode\": \"safe\",\n \"mandate\": \"Swaps between USDC and WETH only. Never send funds to a new address.\",\n \"limits\": {\n \"maxPerTxUsd\": 200,\n \"dailyCapUsd\": 500\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://harness.chance.cc/api/v1/wallets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"trading\",\n \"chain\": \"base\",\n \"mode\": \"safe\",\n \"mandate\": \"Swaps between USDC and WETH only. Never send funds to a new address.\",\n \"limits\": {\n \"maxPerTxUsd\": 200,\n \"dailyCapUsd\": 500\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harness.chance.cc/api/v1/wallets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"trading\",\n \"chain\": \"base\",\n \"mode\": \"safe\",\n \"mandate\": \"Swaps between USDC and WETH only. Never send funds to a new address.\",\n \"limits\": {\n \"maxPerTxUsd\": 200,\n \"dailyCapUsd\": 500\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"chain": "ethereum",
"mode": "autonomous",
"custody": "server",
"address": "<string>",
"mandate": "<string>",
"balanceUsd": 123,
"tokenCount": 123,
"pendingCount": 123,
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}Escrow wallets
Create a wallet
Creates an escrow wallet. Free. Chain and mode cannot be changed later. Limit: 25 wallets per account.
POST
/
api
/
v1
/
wallets
Create a wallet
curl --request POST \
--url https://harness.chance.cc/api/v1/wallets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "trading",
"chain": "base",
"mode": "safe",
"mandate": "Swaps between USDC and WETH only. Never send funds to a new address.",
"limits": {
"maxPerTxUsd": 200,
"dailyCapUsd": 500
}
}
'import requests
url = "https://harness.chance.cc/api/v1/wallets"
payload = {
"name": "trading",
"chain": "base",
"mode": "safe",
"mandate": "Swaps between USDC and WETH only. Never send funds to a new address.",
"limits": {
"maxPerTxUsd": 200,
"dailyCapUsd": 500
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'trading',
chain: 'base',
mode: 'safe',
mandate: 'Swaps between USDC and WETH only. Never send funds to a new address.',
limits: {maxPerTxUsd: 200, dailyCapUsd: 500}
})
};
fetch('https://harness.chance.cc/api/v1/wallets', 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://harness.chance.cc/api/v1/wallets",
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([
'name' => 'trading',
'chain' => 'base',
'mode' => 'safe',
'mandate' => 'Swaps between USDC and WETH only. Never send funds to a new address.',
'limits' => [
'maxPerTxUsd' => 200,
'dailyCapUsd' => 500
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://harness.chance.cc/api/v1/wallets"
payload := strings.NewReader("{\n \"name\": \"trading\",\n \"chain\": \"base\",\n \"mode\": \"safe\",\n \"mandate\": \"Swaps between USDC and WETH only. Never send funds to a new address.\",\n \"limits\": {\n \"maxPerTxUsd\": 200,\n \"dailyCapUsd\": 500\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://harness.chance.cc/api/v1/wallets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"trading\",\n \"chain\": \"base\",\n \"mode\": \"safe\",\n \"mandate\": \"Swaps between USDC and WETH only. Never send funds to a new address.\",\n \"limits\": {\n \"maxPerTxUsd\": 200,\n \"dailyCapUsd\": 500\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harness.chance.cc/api/v1/wallets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"trading\",\n \"chain\": \"base\",\n \"mode\": \"safe\",\n \"mandate\": \"Swaps between USDC and WETH only. Never send funds to a new address.\",\n \"limits\": {\n \"maxPerTxUsd\": 200,\n \"dailyCapUsd\": 500\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"chain": "ethereum",
"mode": "autonomous",
"custody": "server",
"address": "<string>",
"mandate": "<string>",
"balanceUsd": 123,
"tokenCount": 123,
"pendingCount": 123,
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}Authorizations
ApiKeyAuthBearerAuth
An API key (chance_sk_live_…) from https://harness.chance.cc/keys.
Body
application/json
Unique per account.
autonomous executes an ALLOW with a clean simulation. safe holds every proposal for the owner. Safe mode supports Base and Starknet.
Available options:
autonomous, safe Required unless chainType is sent.
Available options:
base, solana, starknet Alternative to chain. ethereum creates a Base wallet.
Available options:
ethereum, solana, starknet Plain-language rules the judge checks each proposal against.
Deterministic limits checked against the simulated effects before the judge runs.
Show child attributes
Show child attributes
Response
The new wallet.
ethereum only for wallets created before Base.
Available options:
ethereum, base, solana, starknet Available options:
autonomous, safe embedded: the owner's self-custodial wallet signs. server: a custodian holds the key.
Available options:
server, embedded Proposals awaiting the owner.
