curl --request POST \
--url https://testnet.walletkit.com/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"wallet_address": "<string>",
"argument_rules": [
{
"argument": "<string>",
"value": "<string>"
}
],
"developer_secret": "<string>",
"user_pin": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://testnet.walletkit.com/policies"
payload = {
"name": "<string>",
"wallet_address": "<string>",
"argument_rules": [
{
"argument": "<string>",
"value": "<string>"
}
],
"developer_secret": "<string>",
"user_pin": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
wallet_address: '<string>',
argument_rules: [{argument: '<string>', value: '<string>'}],
developer_secret: '<string>',
user_pin: '<string>',
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://testnet.walletkit.com/policies', 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://testnet.walletkit.com/policies",
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' => '<string>',
'wallet_address' => '<string>',
'argument_rules' => [
[
'argument' => '<string>',
'value' => '<string>'
]
],
'developer_secret' => '<string>',
'user_pin' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://testnet.walletkit.com/policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"argument_rules\": [\n {\n \"argument\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"developer_secret\": \"<string>\",\n \"user_pin\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://testnet.walletkit.com/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"argument_rules\": [\n {\n \"argument\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"developer_secret\": \"<string>\",\n \"user_pin\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.walletkit.com/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"argument_rules\": [\n {\n \"argument\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"developer_secret\": \"<string>\",\n \"user_pin\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"project_id": "<string>",
"network": "Ethereum",
"wallet_address": "<string>",
"argument_rules": [
{
"argument": "<string>",
"operator": "eq",
"value": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Create Policy
Creates a policy that grants developers temporary permission to perform specific actions on users’ behalf for a limited time.
curl --request POST \
--url https://testnet.walletkit.com/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"wallet_address": "<string>",
"argument_rules": [
{
"argument": "<string>",
"value": "<string>"
}
],
"developer_secret": "<string>",
"user_pin": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://testnet.walletkit.com/policies"
payload = {
"name": "<string>",
"wallet_address": "<string>",
"argument_rules": [
{
"argument": "<string>",
"value": "<string>"
}
],
"developer_secret": "<string>",
"user_pin": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
wallet_address: '<string>',
argument_rules: [{argument: '<string>', value: '<string>'}],
developer_secret: '<string>',
user_pin: '<string>',
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://testnet.walletkit.com/policies', 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://testnet.walletkit.com/policies",
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' => '<string>',
'wallet_address' => '<string>',
'argument_rules' => [
[
'argument' => '<string>',
'value' => '<string>'
]
],
'developer_secret' => '<string>',
'user_pin' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://testnet.walletkit.com/policies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"argument_rules\": [\n {\n \"argument\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"developer_secret\": \"<string>\",\n \"user_pin\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://testnet.walletkit.com/policies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"argument_rules\": [\n {\n \"argument\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"developer_secret\": \"<string>\",\n \"user_pin\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.walletkit.com/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"wallet_address\": \"<string>\",\n \"argument_rules\": [\n {\n \"argument\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"developer_secret\": \"<string>\",\n \"user_pin\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"project_id": "<string>",
"network": "Ethereum",
"wallet_address": "<string>",
"argument_rules": [
{
"argument": "<string>",
"operator": "eq",
"value": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Headers
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Ethereum, Polygon, Base, Avalanche, Polkadot, Vara A list of rules that govern the arguments of the function calls that the developer is allowed to make.
Show child attributes
Show child attributes
On testnet, the developer_secret is always "testnet-secret". On mainnet, the developer_secret is set by the developer during account activation.
A 6-digit numeric pin that is only known to the user, set during wallet creation. This pin is required to sign transactions from this wallet.
The time at which the policy expires. The developer will no longer be able to make function calls on the user's behalf after this time. When omitted, the policy will never expire.
Response
Ethereum, Polygon, Base, Avalanche, Polkadot, Vara Show child attributes
Show child attributes