POST
/
add-policy

Example values you can use to demo the API:

{
    "walletAddress": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
    "name": "Sample Policy",
    "description": "This is a sample policy",
    "isPublic": true,
    "isEnabled": true,
    "isApplicableToAllNetworks": false,
    "enabledChains": [
        80002
    ],
    "supportedEPVersions": ["EPV_06", "EPV_07"],
    "isPerpetual": false,
    "startTime": "2024-06-26T00:40:00.000Z",
    "endTime": "2024-06-27T23:59:59.999Z",
    "globalMaximumApplicable": true,
    "globalMaximumUsd": 5000,
    "globalMaximumNative": 1000,
    "globalMaximumOpCount": 1000,
    "perUserMaximumApplicable": true,
    "perUserMaximumUsd": 100,
    "perUserMaximumNative": 200,
    "perUserMaximumOpCount": 50,
    "perOpMaximumApplicable": true,
    "perOpMaximumUsd": 10,
    "perOpMaximumNative": 20
}

Example response:

{
    "createdAt": "2024-06-30T17:39:26.938Z",
    "updatedAt": "2024-06-30T17:39:26.939Z",
    "id": 5,
    "walletAddress": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
    "name": "Sample Policy",
    "description": "This is a sample policy",
    "isPublic": true,
    "isEnabled": true,
    "isApplicableToAllNetworks": false,
    "enabledChains": [
        80002
    ],
    "supportedEPVersions": [
        "EPV_06",
        "EPV_07"
    ],
    "isPerpetual": false,
    "startTime": "2024-06-26T00:40:00.000Z",
    "endTime": "2024-06-27T23:59:59.999Z",
    "globalMaximumApplicable": true,
    "globalMaximumUsd": "5000.0000",
    "globalMaximumNative": "1000.000000000000000000",
    "globalMaximumOpCount": 1000,
    "perUserMaximumApplicable": true,
    "perUserMaximumUsd": "100.0000",
    "perUserMaximumNative": "200.000000000000000000",
    "perUserMaximumOpCount": 50,
    "perOpMaximumApplicable": true,
    "perOpMaximumUsd": "10.0000",
    "perOpMaximumNative": "20.000000000000000000",
    "addressAllowList": null,
    "addressBlockList": null
}

Headers

apikey
string
required

API key for authentication

Body

application/json
isEnabled
boolean
required
isPublic
boolean
required
name
string
required
walletAddress
string
required
description
string
enabledChains
integer[]
endTime
string
globalMaximumApplicable
boolean
globalMaximumNative
number
globalMaximumOpCount
number
globalMaximumUsd
number
isApplicableToAllNetworks
boolean
isPerpetual
boolean
perOpMaximumApplicable
boolean
perOpMaximumNative
number
perOpMaximumUsd
number
perUserMaximumApplicable
boolean
perUserMaximumNative
number
perUserMaximumOpCount
number
perUserMaximumUsd
number
startTime
string
supportedEPVersions
string[]

Response

201 - application/json
addressAllowList
string[] | null
addressBlockList
string[] | null
createdAt
string
description
string
enabledChains
integer[]
endTime
string
globalMaximumApplicable
boolean
globalMaximumNative
string
globalMaximumOpCount
integer
globalMaximumUsd
string
id
integer
isApplicableToAllNetworks
boolean
isEnabled
boolean
isPerpetual
boolean
isPublic
boolean
name
string
perOpMaximumApplicable
boolean
perOpMaximumNative
string
perOpMaximumUsd
string
perUserMaximumApplicable
boolean
perUserMaximumNative
string
perUserMaximumOpCount
integer
perUserMaximumUsd
string
startTime
string
supportedEPVersions
string[]
updatedAt
string
walletAddress
string