Endpoint reference

POST /api/v1/smart-accounts/onboarding-challenges

Request body

FieldTypeDetails
ownervalue
required
addressvalue
required
manifestIdstring
required
noncevalue
required
issuedAtinteger
required
No more than 30 seconds ahead of server time.
expiresAtinteger
required
Future Unix seconds, after issuedAt and no more than 300 seconds later.
grantobject
required
Browser-selected lowercase UUID v4 and distinct browser API key. Scopes must be exactly read, plan, relay in that order; no onchain signing or spending authority.
Fields
FieldTypeDetails
idstring (uuid)
required
botAddressvalue
required
scopesarray
required

Values: [["read","plan","relay"]]

expiresAtinteger
required
After the setup authorization expires and no more than 3600 seconds after its issuedAt.
labelstring
required
JSON schema
{
  "type": "object",
  "properties": {
    "owner": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Address"
        },
        {
          "not": {
            "enum": [
              "0x0000000000000000000000000000000000000000",
              "0x0000000000000000000000000000000000000001"
            ]
          }
        }
      ]
    },
    "address": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Address"
        },
        {
          "not": {
            "enum": [
              "0x0000000000000000000000000000000000000000",
              "0x0000000000000000000000000000000000000001"
            ]
          }
        }
      ]
    },
    "manifestId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9:_-]{1,192}$"
    },
    "nonce": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Hash"
        },
        {
          "not": {
            "const": "0x0000000000000000000000000000000000000000000000000000000000000000"
          }
        }
      ]
    },
    "issuedAt": {
      "$ref": "#/components/schemas/UnixSeconds",
      "description": "No more than 30 seconds ahead of server time."
    },
    "expiresAt": {
      "$ref": "#/components/schemas/UnixSeconds",
      "description": "Future Unix seconds, after issuedAt and no more than 300 seconds later."
    },
    "grant": {
      "$ref": "#/components/schemas/SmartOnboardingGrant"
    }
  },
  "required": [
    "owner",
    "address",
    "manifestId",
    "nonce",
    "issuedAt",
    "expiresAt",
    "grant"
  ],
  "additionalProperties": false,
  "description": "Public read for one canonically deployed sole-owner Base Safe without spending sessions. Owner, wallet and browser key must be distinct. All fields are required; unknown fields are rejected. This read neither enrolls an account nor consumes the nonce."
}

Response 200

FieldTypeDetails
stateobject
required
Fields
FieldTypeDetails
chainIdinteger
required
addressstring
required
manifestIdstring
required
manifestRevisionstring
required
ownersarray
required
Fields

string

thresholdinteger
required
safeNoncestring
required
uint256 as a lossless decimal string
stateHashstring
required
evidenceobject
required
Fields
FieldTypeDetails
chainIdinteger
required

Values: [1,10,8453,42161,84532,421614,11155111,11155420]

blockNumberstring
required
uint256 as a lossless decimal string
blockHashstring
required
timestampstring
required
uint256 as a lossless decimal string
sourcestring
required

Values: ["onchain"]

codeHashesarray
required
Fields
FieldTypeDetails
addressstring
required
runtimeCodeHashstring
required
modulesone of
required
moduleConfigurationVerifiedboolean
required
executionVerifiedboolean
required

Values: [false]

ownerProfileobject
optional
Fields
FieldTypeDetails
versionstring
required

Values: ["center-passkey-v1"]

signerobject
required
devicesarray
optional
recoveryOwnerobject
required
digeststring
required
typedDataobject
required
Fields
FieldTypeDetails
domainobject
required
Fields
FieldTypeDetails
namestring
required

Values: ["Juicebox Center Account Setup"]

versionstring
required

Values: ["1"]

chainIdinteger
required

Values: [8453]

verifyingContractstring
required
saltstring
required
primaryTypestring
required

Values: ["SetupAccount"]

typesobject
required

Values: [{"SetupAccount":[{"name":"accountId","type":"string"},{"name":"owner","type":"address"},{"name":"manifestId","type":"string"},{"name":"manifestRevision","type":"bytes32"},{"name":"initializerHash","type":"bytes32"},{"name":"stateHash","type":"bytes32"},{"name":"nonce","type":"bytes32"},{"name":"issuedAt","type":"uint64"},{"name":"expiresAt","type":"uint64"},{"name":"grantId","type":"string"},{"name":"botAddress","type":"address"},{"name":"scopes","type":"string[]"},{"name":"grantExpiresAt","type":"uint64"},{"name":"label","type":"string"}]}]

messageobject
required
Fields
FieldTypeDetails
accountIdstring
required
Authority chain and lowercase owner address; the authority chain is independent of a transaction's destination chain.
ownervalue
required
manifestIdstring
required
manifestRevisionstring
required
initializerHashstring
required
stateHashstring
required
noncevalue
required
issuedAtstring
required
Typed-data uint64 serialized as a decimal string. Request timestamps use JSON integers in Unix seconds.
expiresAtstring
required
Typed-data uint64 serialized as a decimal string. Request timestamps use JSON integers in Unix seconds.
grantIdstring (uuid)
required
botAddressvalue
required
scopesarray
required

Values: [["read","plan","relay"]]

grantExpiresAtstring
required
Typed-data uint64 serialized as a decimal string. Request timestamps use JSON integers in Unix seconds.
labelstring
required
JSON schema
{
  "type": "object",
  "properties": {
    "state": {
      "$ref": "#/components/schemas/SmartAccountState"
    },
    "digest": {
      "$ref": "#/components/schemas/Hash"
    },
    "typedData": {
      "type": "object",
      "properties": {
        "domain": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "const": "Juicebox Center Account Setup"
            },
            "version": {
              "type": "string",
              "const": "1"
            },
            "chainId": {
              "type": "integer",
              "const": 8453
            },
            "verifyingContract": {
              "$ref": "#/components/schemas/Address"
            },
            "salt": {
              "$ref": "#/components/schemas/Hash"
            }
          },
          "required": [
            "name",
            "version",
            "chainId",
            "verifyingContract",
            "salt"
          ],
          "additionalProperties": false
        },
        "primaryType": {
          "type": "string",
          "const": "SetupAccount"
        },
        "types": {
          "type": "object",
          "const": {
            "SetupAccount": [
              {
                "name": "accountId",
                "type": "string"
              },
              {
                "name": "owner",
                "type": "address"
              },
              {
                "name": "manifestId",
                "type": "string"
              },
              {
                "name": "manifestRevision",
                "type": "bytes32"
              },
              {
                "name": "initializerHash",
                "type": "bytes32"
              },
              {
                "name": "stateHash",
                "type": "bytes32"
              },
              {
                "name": "nonce",
                "type": "bytes32"
              },
              {
                "name": "issuedAt",
                "type": "uint64"
              },
              {
                "name": "expiresAt",
                "type": "uint64"
              },
              {
                "name": "grantId",
                "type": "string"
              },
              {
                "name": "botAddress",
                "type": "address"
              },
              {
                "name": "scopes",
                "type": "string[]"
              },
              {
                "name": "grantExpiresAt",
                "type": "uint64"
              },
              {
                "name": "label",
                "type": "string"
              }
            ]
          }
        },
        "message": {
          "type": "object",
          "properties": {
            "accountId": {
              "$ref": "#/components/schemas/AccountId"
            },
            "owner": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Address"
                },
                {
                  "not": {
                    "enum": [
                      "0x0000000000000000000000000000000000000000",
                      "0x0000000000000000000000000000000000000001"
                    ]
                  }
                }
              ]
            },
            "manifestId": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9:_-]{1,192}$"
            },
            "manifestRevision": {
              "$ref": "#/components/schemas/Hash"
            },
            "initializerHash": {
              "$ref": "#/components/schemas/Hash"
            },
            "stateHash": {
              "$ref": "#/components/schemas/Hash"
            },
            "nonce": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Hash"
                },
                {
                  "not": {
                    "const": "0x0000000000000000000000000000000000000000000000000000000000000000"
                  }
                }
              ]
            },
            "issuedAt": {
              "type": "string",
              "pattern": "^(?:0|9007199254740991|[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990[0-9]{0})$",
              "description": "Typed-data uint64 serialized as a decimal string. Request timestamps use JSON integers in Unix seconds."
            },
            "expiresAt": {
              "type": "string",
              "pattern": "^(?:0|9007199254740991|[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990[0-9]{0})$",
              "description": "Typed-data uint64 serialized as a decimal string. Request timestamps use JSON integers in Unix seconds."
            },
            "grantId": {
              "type": "string",
              "format": "uuid",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
            },
            "botAddress": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Address"
                },
                {
                  "not": {
                    "enum": [
                      "0x0000000000000000000000000000000000000000",
                      "0x0000000000000000000000000000000000000001"
                    ]
                  }
                }
              ]
            },
            "scopes": {
              "type": "array",
              "const": [
                "read",
                "plan",
                "relay"
              ]
            },
            "grantExpiresAt": {
              "type": "string",
              "pattern": "^(?:0|9007199254740991|[1-9][0-9]{0,14}|[1-8][0-9]{15}|900[0-6][0-9]{12}|90070[0-9]{11}|90071[0-8][0-9]{10}|900719[0-8][0-9]{9}|9007199[0-1][0-9]{8}|90071992[0-4][0-9]{7}|900719925[0-3][0-9]{6}|9007199254[0-6][0-9]{5}|90071992547[0-3][0-9]{4}|9007199254740[0-8][0-9]{2}|90071992547409[0-8][0-9]{1}|9007199254740990[0-9]{0})$",
              "description": "Typed-data uint64 serialized as a decimal string. Request timestamps use JSON integers in Unix seconds."
            },
            "label": {
              "type": "string",
              "pattern": "^[^\\u0000-\\u001f\\u007f]*$",
              "x-maxUtf8Bytes": 120
            }
          },
          "required": [
            "accountId",
            "owner",
            "manifestId",
            "manifestRevision",
            "initializerHash",
            "stateHash",
            "nonce",
            "issuedAt",
            "expiresAt",
            "grantId",
            "botAddress",
            "scopes",
            "grantExpiresAt",
            "label"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "domain",
        "primaryType",
        "types",
        "message"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "state",
    "digest",
    "typedData"
  ],
  "additionalProperties": false
}