accs v1

Create an account object.

Changed on

Creates a new blockchain account for the provided player. If not player is provided, a new one will be created.

Account creation does not consume any gas. All accounts of a player will use the same address across blockchains.

Each player can only have one account per chain.

post/v1/accounts

Request

  • Base URL: https://api.openfort.io
  • URL: https://api.openfort.io/v1/accounts
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer

Request body

chainIdinteger required

The chain ID. Must be a supported chain.

externalOwnerAddressstring

Use this parameter to create a new Account for Player with the provided owner address.

accountTypestring

The type of smart account that will be created (e.g. UpgradeableV6, UpgradeableV5, Simple). Defaults to UpgradeableV6.

defaultGuardianboolean

For account types that support social recovery, wether to enable Openfort as guardian or not. Defaults to false.

playerstring

ID of the player this account belongs to (starts with pla_). If none is provided, a new player will be created.

Example request

{
  "chainId": 80002,
  "externalOwnerAddress": "0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d",
  "accountType": "UpgradeableV6",
  "player": "pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60"
}

Response

Successful response.

idstring required
object'account' required
createdAtinteger required
addressstring required
ownerAddressstring required
deployedboolean required
custodialboolean required
embeddedSignerboolean required
chainIdinteger required

The chain ID.

accountTypestring required
pendingOwnerAddressstring

Example response

{
  "transactionIntents": [
    {
      "chainId": 5,
      "details": {
        "from": "0x8ab66318aCC6b29A27e74e534bfe3ecf81C50387",
        "data": "0x8c5a...",
        "nonce": "0",
        "gas": "21000",
        "maxFeePerGas": "1000000000",
        "maxPriorityFeePerGas": "1000000000",
        "value": "0x8ab66318aCC6b29A27e74e534bfe3ecf81C50387"
      },
      "response": {
        "error": {
          "reason": "AA31: paymaster deposit too low",
          "name": "ExecutionResult",
          "explanation": {
            "cause": "The paymaster does not have enough native tokens deposited in the EntryPoint to cover the gas cost.",
            "solution": "Top up your account balance in the dashboard or deposit more to the Paymaster contract on the relevant chain."
          }
        }
      },
      "finalCost": "0.42",
      "interactions": [
        {
          "value": "1000000000000000000",
          "contract": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35",
          "functionName": "mint",
          "functionArgs": [
            "0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d"
          ]
        }
      ]
    }
  ]
}

Changes

    • info

      removed from the ////// response property anyOf list for the response status

    • info

      removed the zkSync enum value from the ////// response property for the response status

    • breaking

      the /////// response's property type changed from no type to object for status

    • info

      the endpoint scheme security auth_token was added to the API

    • info

      the endpoint scheme security better_auth was removed from the API

    • info

      the security scope accounts:write was added to the endpoint's security scheme sk

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property //////// to the response with the status

    • info

      added the optional property //////// to the response with the status

    • info

      added the required property //////// to the response with the status