Management API Reference

API Reference

The Openfort API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

You can use the Openfort API in test mode, which doesn't affect your live data or interact with the banking networks. The API key you use to authenticate the request determines whether the request is live mode or test mode.

The Openfort API doesn't support bulk updates. You can work on only one object per request.

Authentication

The Openfort API uses API keys to authenticate requests. You can view and manage your API keys in the Openfort Dashboard.

Test mode secret keys have the prefix sk_test_ and live mode secret keys have the prefix sk_live_.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

Use your API key by setting it in the initial configuration of Openfort. The Node.js library will then automatically send this key in each request.

All API requests must be made over HTTPS and must be authenticated. Calls made over plain HTTP will fail. Below, you can see how to send a GET request to the players endpoint to get a list of all your players.

All API requests must be authenticated and made over HTTPS.

Authenticated

_10
curl https://api.openfort.xyz/v1/players \
_10
-H "Authorization: Bearer sk_test_bdd0•••••4f23"

Expanding Responses

Many objects allow you to request additional information as an expanded response by using the expand request parameter. This parameter is available on multiple API requests, and applies to the response of that request only.

In many cases, an object contains the ID of a related object in its response properties. For example, a Player can have multiple accounts. Those objects can be expanded inline with the expand request parameter. ID fields that can be expanded into objects are noted in this documentation with the expandable label.

You can use the expand param on any endpoint which returns expandable fields, including list, create, and update endpoints.

You can expand several objects at once by identifying multiple items in the expand array.

Authenticated

_10
curl https://api.openfort.xyz/v1/players/pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60 \
_10
-u YOUR_SECRET_KEY: \
_10
-d "expand[]=accounts"

Response

_35
{
_35
"id": "pla_...",
_35
"object": "player",
_35
"createdAt": 1689869074,
_35
"name": "Frank McCallister",
_35
"email": "Frank@dMcCallister.com",
_35
"description": "Tutorial",
_35
"livemode": false,
_35
"metadata": null,
_35
"accounts": [
_35
{
_35
"id": "acc_...",
_35
"object": "account",
_35
"createdAt": 1689869074,
_35
"address": "0x0B49...cc73",
_35
"chainId": 80002,
_35
"custodial": true,
_35
"deployed": false
_35
},
_35
{
_35
"id": "acc_7ccae011-4f30-41c0-876f-27679d3e81ef",
_35
"object": "account",
_35
"createdAt": 1689869074,
_35
"address": "0x0B49...cc73",
_35
"chainId": 5,
_35
"custodial": true,
_35
"deployed": false
_35
}
_35
],
_35
"transactionIntents": [
_35
{
_35
"id":"tin_..."
_35
}
_35
]
_35
}

Errors

In this guide, we will talk about what happens when something goes wrong while you work with the API. Let's look at some status codes and error types you might encounter.

You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging.

Verify auth token.

Verifies the token generated by Openfort Auth.

Query Parameters
  • token
    REQUIRED
    string

    Specifies the auth token.

get/iam/v1/verify

1curl https://api.openfort.xyz/iam/v1/verify \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9qZWN0SWQiOiJwcm9qZWN0XzQ4ZWViYTU3LTJjZDUtNDE1OS1hMmNiLTA1N2EyM2EzNWU2NSIsInVzZXJJZCI6InVzZXJfNDhlZWI1Ny0yY2Q1LTQxNTktYTJjYi0wNTdhMjNhMzVlNjUiLCJpYXQiOjE2MjY0NjY0NzcsImV4cCI6MTYyN'
{
  "projectId": "pro_...",
  "expiration": 1234567890,
  "issuedAt": 1234567890,
  "issuer": "openfort.xyz",
  "sessionId": "...",
  "playerId": "pla_...",
  "livemode": true
}

Create an authenticated player.

Creates an authenticated player.

The player will be authenticated with the provider and an embedded account can be pre generated.

Body Parameters
  • thirdPartyUserId
    REQUIRED
    string

    The third party user id.

  • thirdPartyProvider
    REQUIRED
    string

    One of:

    • accelbyte
    • firebase
    • lootlocker
    • playfab
    • supabase
    • custom
    • oidc
    • telegramMiniApp

    The third party provider.

  • preGenerateEmbeddedAccount
    REQUIRED
    boolean

    Pre generate embedded account.

  • chainIdinteger

    The chain ID. Must be a supported chain.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

post/iam/v1/players

1curl https://api.openfort.xyz/iam/v1/players \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'thirdPartyUserId=dsajkl23r43l1234jl' \
4  -d 'thirdPartyProvider=firebase' \
5  -d 'preGenerateEmbeddedAccount=true'
{
  "id": "pla_ff54b031-a878-4ca2-9cf5-ae190f921e9b",
  "object": "player",
  "createdAt": 1691658234,
  "linkedAccounts": [
    {
      "provider": "email",
      "email": "jaume@openfort.xyz",
      "disabled": false,
      "updatedAt": 1691658234
    }
  ]
}

List authenticated players.

Retrieves a list of authenticated players.

Players have linked accounts and are authenticated with a provider.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • emailstring

    Specifies the email address of the user.

  • externalUserIdstring

    Specifies the external user ID.

get/iam/v1/players

1curl https://api.openfort.xyz/iam/v1/players \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/iam/v1/players",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "pla_ff54b031-a878-4ca2-9cf5-ae190f921e9b",
      "object": "player",
      "createdAt": 1691658234,
      "linkedAccounts": [
        {
          "provider": "email",
          "email": "jaume@openfort.xyz",
          "disabled": false,
          "updatedAt": 1691658234
        }
      ]
    }
  ]
}

Deletes a player auth object.

Deletes a player auth object.

It will delete all linked accounts the player is authenticated with.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

delete/iam/v1/players/{id}

1curl https://api.openfort.xyz/iam/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pla_ff54b031-a878-4ca2-9cf5-ae190f921e9b",
  "object": "player",
  "createdAt": 1691658234,
  "linkedAccounts": [
    {
      "provider": "email",
      "email": "jaume@openfort.xyz",
      "disabled": false,
      "updatedAt": 1691658234
    }
  ]
}

Create oauth configuration.

The endpoint creates oauth configuration for the current project environment.

post/iam/v1/config

1curl https://api.openfort.xyz/iam/v1/config \
2  -u "$YOUR_SECRET_KEY:"
{
  "enabled": true,
  "baseUrl": "https://mygame.dev.gamingservices.accelbyte.io/",
  "clientId": "1234567890abcdef1234567890abcdef",
  "clientSecret": "abcdef1234567890abcdef1234567890",
  "provider": "accelbyte"
}

List of oauth configurations.

Deprecated

List configured OAuth methods for the current project environment.

get/iam/v1/oauth

1curl https://api.openfort.xyz/iam/v1/oauth \
2  -u "$YOUR_SECRET_KEY:"
{
  "data": [
    {
      "enabled": true,
      "baseUrl": "https://mygame.dev.gamingservices.accelbyte.io/",
      "clientId": "1234567890abcdef1234567890abcdef",
      "clientSecret": "abcdef1234567890abcdef1234567890",
      "provider": "accelbyte"
    }
  ]
}

Create oauth configuration.

The endpoint creates oauth configuration for the current project environment.

post/iam/v1/config

1curl https://api.openfort.xyz/iam/v1/config \
2  -u "$YOUR_SECRET_KEY:"
{
  "enabled": true,
  "baseUrl": "https://mygame.dev.gamingservices.accelbyte.io/",
  "clientId": "1234567890abcdef1234567890abcdef",
  "clientSecret": "abcdef1234567890abcdef1234567890",
  "provider": "accelbyte"
}

Get oauth configuration.

Deprecated

The endpoint retrieves oauth configuration for specified provider for the current project environment.

Path Parameters
  • provider
    REQUIRED
    string

    One of:

    • google
    • twitter
    • facebook
    • discord
    • epic_games
    • telegram
    • line

    Specifies the oauth provider type.

get/iam/v1/oauth/{provider}

1curl https://api.openfort.xyz/iam/v1/oauth/{provider} \
2  -u "$YOUR_SECRET_KEY:"
{
  "enabled": true,
  "baseUrl": "https://mygame.dev.gamingservices.accelbyte.io/",
  "clientId": "1234567890abcdef1234567890abcdef",
  "clientSecret": "abcdef1234567890abcdef1234567890",
  "provider": "accelbyte"
}

Delete oauth configuration.

Deprecated

The endpoint deletes oauth configuration for specified provider for the current project environment.

Path Parameters
  • provider
    REQUIRED
    string

    One of:

    • google
    • twitter
    • facebook
    • discord
    • epic_games
    • telegram
    • line

    Specifies the oauth provider type.

delete/iam/v1/oauth/{provider}

1curl https://api.openfort.xyz/iam/v1/oauth/{provider} \
2  -u "$YOUR_SECRET_KEY:"

Retrieve player by oauth token.

The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player.

Returns the latest 10 transaction intents for the player.

Body Parameters
  • provider
    REQUIRED
    string

    One of:

    • google
    • twitter
    • facebook
    • discord
    • epic_games
    • telegram
    • accelbyte
    • firebase
    • lootlocker
    • playfab
    • supabase
    • custom
    • oidc
    • telegramMiniApp

    OAuth provider

  • token
    REQUIRED
    string

    Token to be verified

  • tokenType
    REQUIRED
    string

    One of:

    • idToken
    • customToken

    Type of the token.

  • expandarray

    Specifies the fields to expand in the response.

post/iam/v1/oauth/verify

1curl https://api.openfort.xyz/iam/v1/oauth/verify \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'provider=firebase' \
4  -d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' \
5  -d 'tokenType=idToken'
{
  "id": "pla_00000000-0000-0000-0000-000000000000",
  "createdAt": 1689869074,
  "object": "player",
  "description": "John Smith",
  "metadata": {
    "firstName": "John",
    "lastName": "Smith"
  },
  "name": "My Player",
  "accounts": [
    {
      "id": "acc_8888888888-8888-8888-8888-888888888888"
    }
  ],
  "transactionIntents": [
    {
      "id": "tin_AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
    }
  ]
}

Retrieve player by token.

Deprecated

The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player.

Returns the latest 10 transaction intents for the player.

Path Parameters
  • provider
    REQUIRED
    no type

    OAuth provider

Body Parameters
  • token
    REQUIRED
    string

    Access token to be verified

post/iam/v1/oauth/{provider}/verify

1curl https://api.openfort.xyz/iam/v1/oauth/{provider}/verify \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'
{
  "id": "pla_00000000-0000-0000-0000-000000000000",
  "createdAt": 1689869074,
  "object": "player",
  "description": "John Smith",
  "metadata": {
    "firstName": "John",
    "lastName": "Smith"
  },
  "name": "My Player",
  "accounts": [
    {
      "id": "acc_8888888888-8888-8888-8888-888888888888"
    }
  ],
  "transactionIntents": [
    {
      "id": "tin_AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
    }
  ]
}

List accounts of a player.

Returns a list of accounts for the given player.

This object represents a player's account, which is a blockchain smart account that can be used to interact with the blockchain.

The accounts are returned sorted by creation date, with the most recently created accounts appearing first.

Returns the latest 10 transaction intents for each account.

By default, a maximum of 10 accounts are shown per page.

Query Parameters
  • player
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_)

  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • expandarray

    An array with:

    • transactionIntents
    • player

    Specifies the fields to expand in the response.

get/v1/accounts

1curl https://api.openfort.xyz/v1/accounts \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'player=pla_6f6c9067-89fa-4fc8-ac72-c242a268c584'
{
  "object": "list",
  "url": "/v1/accounts",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
      "createdAt": 1689869074,
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "chainId": 80002,
      "deployed": true,
      "custodial": false,
      "embeddedSigner": false,
      "object": "account",
      "accountType": "Upgradeable_v06",
      "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "player": {
        "id": "pla_c502d628-5bb3-42f2-b8d5-62ba46717f3a"
      },
      "transactionIntents": [
        {
          "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
        }
      ]
    }
  ]
}

Create an account object.

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.

Body Parameters
  • chainId
    REQUIRED
    integer

    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. ERC6551V1, ManagedV5, UpgradeableV5, ZKSyncUpgradeableV1). Defaults to UpgradeableV5.

  • defaultGuardianboolean

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

  • tokenContractstring

    If ERC6551, the address of the NFT contract to use

  • tokenIdinteger

    If ERC6551, the tokenId from the NFT contract that will serve as owner

  • playerstring

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

post/v1/accounts

1curl https://api.openfort.xyz/v1/accounts \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002'
{
  "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 80002,
  "deployed": true,
  "custodial": false,
  "embeddedSigner": false,
  "object": "account",
  "accountType": "Upgradeable_v06",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "player": {
    "id": "pla_c502d628-5bb3-42f2-b8d5-62ba46717f3a"
  },
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Get existing account.

Retrieves the details of an existing account.

Supply the unique account ID from either a account creation request or the account list, and Openfort will return the corresponding account information.

Returns the latest 10 transaction intents created by this account.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Query Parameters
  • expandarray

    An array with:

    • transactionIntents
    • player
get/v1/accounts/{id}

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 80002,
  "deployed": true,
  "custodial": false,
  "embeddedSigner": false,
  "object": "account",
  "accountType": "Upgradeable_v06",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "player": {
    "id": "pla_c502d628-5bb3-42f2-b8d5-62ba46717f3a"
  },
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Request transfer ownership of account.

Perform a request to change the owner of an account.

To perform an update on the owner of an account, first you must provide a new owner address. Once requested, the owner must accept to take ownership by calling acceptOwnership() in the smart contract account.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Body Parameters
  • newOwnerAddress
    REQUIRED
    string

    The address of the new owner

  • policy
    REQUIRED
    string

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). A policy must be provided.

post/v1/accounts/{id}/request_transfer_ownership

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/request_transfer_ownership \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'newOwnerAddress=0x1234567890abcdef1234567890abcdef12345678' \
4  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperation": null,
  "chainId": 80002,
  "abstractionType": "standard",
  "details": {
    "from": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "to": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "gas": "0x5208",
    "maxFeePerGas": "0x3b9aca00",
    "maxPriorityFeePerGas": "0x3b9aca00",
    "nonce": "0x0",
    "data": "0x3c44..."
  },
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Cancel request to transfer ownership of an account.

Cancel a pending transfer of ownership.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Body Parameters
  • policy
    REQUIRED
    string

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). A policy must be provided.

post/v1/accounts/{id}/cancel_transfer_ownership

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/cancel_transfer_ownership \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperation": null,
  "chainId": 80002,
  "abstractionType": "standard",
  "details": {
    "from": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "to": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "gas": "0x5208",
    "maxFeePerGas": "0x3b9aca00",
    "maxPriorityFeePerGas": "0x3b9aca00",
    "nonce": "0x0",
    "data": "0x3c44..."
  },
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Sign a given payload

Custodial Accounts only - Signs the typed repositories value with types repositories structure for domain using the EIP-712 specification.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Body Parameters
  • domain
    REQUIRED
    object

    Domain. Specific to the dApp.

  • types
    REQUIRED
    object
  • primaryType
    REQUIRED
    string
  • value
    REQUIRED
    object
  • hashstring

    Hash to verify and that will be signed

post/v1/accounts/{id}/sign_payload

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/sign_payload \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'domain[0][chainId]=80002' \
4  -d 'domain[0][name]=Openfort' \
5  -d 'domain[0][version]=1' \
6  -d 'domain[0][verifyingContract]=0x64452Dff1180b21dc50033e1680bB64CDd492582' \
7  -d 'domain[0][salt]=0xf2d857f4a3edcb9b78b4d503bfe733db1e3f6cdc2b7971ee739626c97e86a558'  -d 'primaryType=Mail' \
{
  "account": "acc_...",
  "hash": "0x25d3...005c",
  "object": "signature",
  "signature": "0x25d3...005c",
  "address": "0x8C5cedA46A2...36Ad2F6255BdBEa"
}

Sync account state with the blockchain

Synchronize the account state with the blockchain. Specifically, it updates the account owner and whether its deployed or not.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

post/v1/accounts/{id}/sync

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/sync \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 80002,
  "deployed": true,
  "custodial": false,
  "embeddedSigner": false,
  "object": "account",
  "accountType": "Upgradeable_v06",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "player": {
    "id": "pla_c502d628-5bb3-42f2-b8d5-62ba46717f3a"
  },
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Deploy an account.

This endpoint can be used to deploy a smart contract account that was counterfactually generated.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Body Parameters
  • policy
    REQUIRED
    string

    The policy ID (starts with pol_)

post/v1/accounts/{id}/deploy

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/deploy \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
{
  "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 80002,
  "deployed": true,
  "custodial": false,
  "embeddedSigner": false,
  "object": "account",
  "accountType": "Upgradeable_v06",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "player": {
    "id": "pla_c502d628-5bb3-42f2-b8d5-62ba46717f3a"
  },
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Start a recovery process of a recoverable account.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Body Parameters
  • newOwnerAddress
    REQUIRED
    string

    Address of the new owner

  • policy
    REQUIRED
    string

    The policy ID (starts with pol_)

post/v1/accounts/{id}/start_recovery

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/start_recovery \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'newOwnerAddress=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d' \
4  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperation": null,
  "chainId": 80002,
  "abstractionType": "standard",
  "details": {
    "from": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "to": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "gas": "0x5208",
    "maxFeePerGas": "0x3b9aca00",
    "maxPriorityFeePerGas": "0x3b9aca00",
    "nonce": "0x0",
    "data": "0x3c44..."
  },
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Complete a recovery process of a recoverable account.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Body Parameters
  • newOwnerAddress
    REQUIRED
    string

    Address of the new owner

  • policy
    REQUIRED
    string

    The policy ID (starts with pol_)

  • signaturesarray

    Signatures by the guardians

post/v1/accounts/{id}/complete_recovery

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/complete_recovery \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'newOwnerAddress=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d' \
4  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperation": null,
  "chainId": 80002,
  "abstractionType": "standard",
  "details": {
    "from": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "to": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "gas": "0x5208",
    "maxFeePerGas": "0x3b9aca00",
    "maxPriorityFeePerGas": "0x3b9aca00",
    "nonce": "0x0",
    "data": "0x3c44..."
  },
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

List contracts.

List of all contracts per project. By default, a maximum of ten contracts are shown.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • namestring

    Specifies the name of the contract.

  • deletedboolean

    Specifies whether to include deleted contracts.

  • chainIdinteger

    The chain ID of the contract.

  • addressstring

    Specifies the address of the contract.

get/v1/contracts

1curl https://api.openfort.xyz/v1/contracts \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/contracts",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
      "createdAt": 1689869074,
      "object": "contract",
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "chainId": 80002,
      "deleted": false,
      "name": "MyContract",
      "publicVerification": true,
      "abi": [
        {
          "constant": false,
          "inputs": [
            {
              "name": "addr",
              "type": "address"
            }
          ]
        }
      ]
    }
  ]
}

Create contract object.

Add a new contract to your project in Openfort

Body Parameters
  • name
    REQUIRED
    string

    Specifies the name of the contract (Only for display purposes).

  • chainId
    REQUIRED
    integer

    Specifies the chain ID of the contract. Must be a supported chain.

  • address
    REQUIRED
    string

    Specifies the address of the contract.

  • abiarray

    Specifies the ABI of the contract.

  • publicVerificationboolean

    Specifies whether to verify the contract publicly.

post/v1/contracts

1curl https://api.openfort.xyz/v1/contracts \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'name=NFT Contract' \
4  -d 'chainId=80002' \
5  -d 'address=0x742e6e61d760164d56f44801054bcf40fa821d97'
{
  "id": "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "object": "contract",
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 80002,
  "deleted": false,
  "name": "MyContract",
  "publicVerification": true,
  "abi": [
    {
      "constant": false,
      "inputs": [
        {
          "name": "addr",
          "type": "address"
        }
      ]
    }
  ]
}

Get a contract.

Retrieve a contract by providing their contract id.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique contract ID (starts with con_).

get/v1/contracts/{id}

1curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "object": "contract",
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 80002,
  "deleted": false,
  "name": "MyContract",
  "publicVerification": true,
  "abi": [
    {
      "constant": false,
      "inputs": [
        {
          "name": "addr",
          "type": "address"
        }
      ]
    }
  ]
}

Updates a contract object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique contract ID (starts with con_).

Body Parameters
  • namestring

    Specifies the name of the contract (Only for display purposes).

  • chainIdinteger

    Specifies the chain ID of the contract. Must be a supported chain.

  • deletedboolean

    Specifies whether to delete the contract.

  • addressstring

    Specifies the address of the contract.

  • abiarray

    Specifies the ABI of the contract.

  • publicVerificationboolean

    Specifies whether to verify the contract publicly.

post/v1/contracts/{id}

1curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "object": "contract",
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 80002,
  "deleted": false,
  "name": "MyContract",
  "publicVerification": true,
  "abi": [
    {
      "constant": false,
      "inputs": [
        {
          "name": "addr",
          "type": "address"
        }
      ]
    }
  ]
}

Deletes a contract object.

Delete a contract from the project by providing its contract id.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique contract ID (starts with con_).

delete/v1/contracts/{id}

1curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "deleted": true,
  "object": "contract"
}

Read on chain contract repositories.

Using this endpoint, you can get the repositories returned by any readable function listed in a contracts ABI. This could be things like querying the totalSupply of a currency contract, the number of owners of an items contract, and more.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique contract ID (starts with con_).

Query Parameters
  • functionName
    REQUIRED
    string

    The function name of the contract.

  • functionArgsarray

    The function arguments of the contract, in string format. Accepts pla_, con_ and acc_ IDs.

get/v1/contracts/{id}/read

1curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35/read \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'functionName=mint'
{
  "id": "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "object": "readContract",
  "functionName": "balanceOf",
  "result": {
    "type": "BigNumber",
    "hex": "0x00"
  }
}

List events.

Returns a list of events.

By default, a maximum of 10 events are shown per page.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • namestring

    Specifies the name of the event

  • deletedboolean

    Specifies if display deleted events

get/v1/events

1curl https://api.openfort.xyz/v1/events \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/events",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "eve_f0f89cf2-c185-40f4-beef-2a250d7a472b",
      "object": "event",
      "topic": "balance.project",
      "threshold": "100",
      "createdAt": 1617226800
    }
  ]
}

Create a new event.

Create a new event.

Body Parameters
  • name
    REQUIRED
    string

    Specifies the name of the event

  • topic
    REQUIRED
    string

    One of:

    • transaction_intent.broadcast
    • transaction_intent.successful
    • transaction_intent.cancelled
    • transaction_intent.failed
    • balance.project
    • balance.contract
    • balance.dev_account
    • test

    Specifies the type of the event (transaction_intent.successful, balance.project, balance.contract, balance.dev_account)

  • contractstring

    Specifies the contract id (if the event is a contract event)

  • functionArgsarray

    Specifies the function arguments (if the event is a contract event)

  • functionNamestring

    Specifies the function name (if the event is a contract event)

  • developerAccountstring

    Specifies the developer account id (if the event is a developer account event)

  • chainIdnumber

    Specifies the chain id (if the event is a developer account event)

  • thresholdstring

    Threshold for the event (if the event is a contract, dev account or project event)

  • numberOfBlocksnumber

    Specifies the number of confirmations required for the event to trigger

post/v1/events

1curl https://api.openfort.xyz/v1/events \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'name=Event Name' \
4  -d 'topic=balance.project'
{
  "id": "eve_f0f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "event",
  "topic": "balance.project",
  "threshold": "100",
  "createdAt": 1617226800
}

Get a single event.

Get a single event.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique event ID (starts with eve_).

get/v1/events/{id}

1curl https://api.openfort.xyz/v1/events/eve_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "eve_f0f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "event",
  "topic": "balance.project",
  "threshold": "100",
  "createdAt": 1617226800
}

Delete an event.

Delete an event.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique event ID (starts with eve_).

delete/v1/events/{id}

1curl https://api.openfort.xyz/v1/events/eve_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "eve_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "deleted": true,
  "object": "event"
}

Create token swap.

Creates token swap.

Body Parameters
  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • fromAddress
    REQUIRED
    string

    The public address that will sign and submit the transaction. If you provide one of a pla_... or acc_... it will be converted to the corresponding address.

  • tokenInAddress
    REQUIRED
    string

    Token address or 'native' to sell

  • tokenOutAddress
    REQUIRED
    string

    Token address or 'native' to buy

  • amount
    REQUIRED
    string

    Amount in the smallest unit of the token

  • tradeType
    REQUIRED
    string

    One of:

    • EXACT_INPUT
    • EXACT_OUTPUT

    The type of trade, exact input or exact output

  • slippagePercentnumber

    The percentage of slippage tolerance. Default = 0.1. Max = 50. Min = 0

  • maxHopsnumber

    Maximum hops allowed in optimal route. Default is 2

  • deadlinenumber

    Latest time swap can execute. Default is 15 minutes

  • policystring

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). If no Policy is provided, the own Account native token funds will be used to pay for gas.

  • optimisticboolean

    Set to true to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

post/v1/exchange

1curl https://api.openfort.xyz/v1/exchange \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002' \
4  -d 'fromAddress=0x680d2719F09B23F644c136Ab7336D42b6a76AdcC' \
5  -d 'tokenInAddress=0x008518e76FAD03f592Bbb7E394C762d5FD54cb97' \
6  -d 'tokenOutAddress=0xF65B6f9c94187276C7d91F4F74134751d248bFeA' \
7  -d 'amount=100000' \
8  -d 'tradeType=EXACT_INPUT'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "details": {
    "userOperationHash": "0x25d3...005c",
    "userOperation": {
      "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
      "nonce": "0x2",
      "initCode": "0x",
      "callData": "0xb61d...0000",
      "callGasLimit": "0x27863",
      "verificationGasLimit": "0x16001",
      "preVerificationGas": "0xb818",
      "maxFeePerGas": "0x62590091",
      "maxPriorityFeePerGas": "0x62590091",
      "paymasterAndData": "0x3210...b51c",
      "signature": "0x6202...3d1b"
    }
  },
  "chainId": 80002,
  "abstractionType": "accountAbstractionV6",
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Quote token swap.

Quote token swap.

Body Parameters
  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • fromAddress
    REQUIRED
    string

    The public address that will sign and submit the transaction. If you provide one of a pla_... or acc_... it will be converted to the corresponding address.

  • tokenInAddress
    REQUIRED
    string

    Token address or 'native' to sell

  • tokenOutAddress
    REQUIRED
    string

    Token address or 'native' to buy

  • amount
    REQUIRED
    string

    Amount in the smallest unit of the token

  • tradeType
    REQUIRED
    string

    One of:

    • EXACT_INPUT
    • EXACT_OUTPUT

    The type of trade, exact input or exact output

  • slippagePercentnumber

    The percentage of slippage tolerance. Default = 0.1. Max = 50. Min = 0

  • maxHopsnumber

    Maximum hops allowed in optimal route. Default is 2

  • deadlinenumber

    Latest time swap can execute. Default is 15 minutes

  • policystring

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). If no Policy is provided, the own Account native token funds will be used to pay for gas.

  • optimisticboolean

    Set to true to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

post/v1/exchange/quote

1curl https://api.openfort.xyz/v1/exchange/quote \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002' \
4  -d 'fromAddress=0x680d2719F09B23F644c136Ab7336D42b6a76AdcC' \
5  -d 'tokenInAddress=0x008518e76FAD03f592Bbb7E394C762d5FD54cb97' \
6  -d 'tokenOutAddress=0xF65B6f9c94187276C7d91F4F74134751d248bFeA' \
7  -d 'amount=100000' \
8  -d 'tradeType=EXACT_INPUT'
{
  "amount": {
    "token": {
      "address": "0x008518e76FAD03f592Bbb7E394C762d5FD54cb97",
      "chainId": 4337,
      "decimals": 18,
      "name": "TOKEN",
      "symbol": "TKN"
    },
    "value": "1000000000000000000"
  },
  "slippage": 0.5,
  "fees": [
    {
      "recipient": "0x008518e76FAD03f592Bbb7E394C762d5FD54cb97",
      "basisPoints": 100,
      "amount": {
        "token": {
          "address": "0x008518e76FAD03f592Bbb7E394C762d5FD54cb97",
          "chainId": 4337,
          "decimals": 18,
          "name": "TOKEN",
          "symbol": "TKN"
        },
        "value": "1000000000000000000"
      }
    }
  ],
  "amountWithMaxSlippage": {
    "token": {
      "address": "0x008518e76FAD03f592Bbb7E394C762d5FD54cb97",
      "chainId": 4337,
      "decimals": 18,
      "name": "TOKEN",
      "symbol": "TKN"
    },
    "value": "1000000000000000000"
  },
  "estimatedTXGasFee": "1000000000000000000",
  "estimatedTXGasFeeToken": "12000",
  "estimatedTXGasFeeUSD": "1"
}

Create a new forwarder contract.

Create a new forwarder contract.

This object represents the forwarder contract that will be used to pay the gas fees of the transactions.

Body Parameters
  • address
    REQUIRED
    string

    Specifies the address of the paymaster

  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • namestring

    Specifies the name of the paymaster

List forwarder contract.

Returns a list of forwarder contract.

This object represents the forwarder contract that will be used to pay the gas fees for the transactions.

By default, a maximum of 10 forwarder contract are shown per page.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

Update a forwarder contract.

Update a forwarder contract.

This object represents the forwarder contract that will be used to pay the gas fees of the transactions.

Path Parameters
  • id
    REQUIRED
    string
Body Parameters
  • address
    REQUIRED
    string

    Specifies the address of the paymaster

  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • namestring

    Specifies the name of the paymaster

Get forwarder contract by id.

Returns the forwarder contract with the given id.

This object represents the forwarder contract that will be used to pay the gas fees for the transactions.

Path Parameters
  • id
    REQUIRED
    string

Delete forwarder contract by id.

Delete the forwarder contract with the given id.

This object represents the forwarder contract that will be used to pay the gas fees for the transactions.

Path Parameters
  • id
    REQUIRED
    string

Get NFTs list of player.

For development purposes only.

Under higher load scenarios, this endpoint may be rate limited.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Query Parameters
  • chainId
    REQUIRED
    integer

    Filter by chain id.

  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • contractarray

    Filter by contract ID (starts with con_).

get/v1/players/{id}/inventory/nft

1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/inventory/nft \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002'
{
  "object": "list",
  "url": "/v1/players/pla_.../inventory/nft",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "assetType": "ERC1155",
      "amount": "1",
      "tokenId": 1,
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "lastTransferredAt": 1689869074
    }
  ]
}

Get cryptocurrency list of player.

For development purposes only.

Under higher load scenarios, this endpoint may be rate limited.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Query Parameters
  • chainId
    REQUIRED
    integer

    Filter by chain id.

  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • contractarray

    Filter by contract ID (starts with con_).

get/v1/players/{id}/inventory/cryptocurrency

1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/inventory/cryptocurrency \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002'
{
  "object": "list",
  "url": "/v1/players/pla_.../inventory/cryptocurrency",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "assetType": "ERC20",
      "amount": "1000000000000000000",
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "lastTransferredAt": 1689869074
    }
  ]
}

Get native token list of player.

For development purposes only.

Under higher load scenarios, this endpoint may be rate limited.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Query Parameters
  • chainId
    REQUIRED
    integer

    Filter by chain id.

get/v1/players/{id}/inventory/native

1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/inventory/native \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002'
{
  "object": "inventory",
  "url": "/v1/players/pla_.../inventory/native",
  "data": {
    "assetType": "ETH",
    "amount": "1000000000000000000",
    "lastTransferredAt": 1689869074
  }
}

Retrieves the NFT assets of an existing account.

For development purposes only.

Under higher load scenarios, this endpoint may be rate limited.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • contractIdarray
get/v1/accounts/{id}/inventory/nft

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/inventory/nft \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/accounts/acc_.../inventory/nft",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "assetType": "ERC1155",
      "amount": "1",
      "tokenId": 1,
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "lastTransferredAt": 1689869074
    }
  ]
}

Retrieves the cryptocurrency assets of an existing account.

For development purposes only.

Under higher load scenarios, this endpoint may be rate limited.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • contractIdarray
get/v1/accounts/{id}/inventory/cryptocurrency

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/inventory/cryptocurrency \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/accounts/acc_.../inventory/cryptocurrency",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "assetType": "ERC20",
      "amount": "1000000000000000000",
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "lastTransferredAt": 1689869074
    }
  ]
}

Retrieves the native asset of an existing account.

For development purposes only.

Under higher load scenarios, this endpoint may be rate limited.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID.

get/v1/accounts/{id}/inventory/native

1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/inventory/native \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "inventory",
  "url": "/v1/accounts/acc_.../inventory/native",
  "data": {
    "assetType": "ETH",
    "amount": "1000000000000000000",
    "lastTransferredAt": 1689869074
  }
}

Create a new paymaster.

Create a new paymaster.

This object represents the paymaster that will be used to pay the gas fees of the transactions.

Body Parameters
  • address
    REQUIRED
    string

    Specifies the address of the paymaster

  • urlstring

    Specifies the paymaster URL

  • contextobject

    Specifies the context, that is, the arbitrary repositories that the specific paymaster may require

  • namestring

    Specifies the name of the paymaster

post/v1/paymasters

1curl https://api.openfort.xyz/v1/paymasters \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x7d526b7e99fbf52850a183...'
{
  "id": "pay_f0f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "paymaster",
  "address": "0x7b9f89cf2c18540f4beef2a250d7a472b",
  "url": "https://rpc.mypaymaster.xyz",
  "context": {
    "key": "value"
  },
  "createdAt": 1617226800
}

List paymasters.

Returns a list of paymasters.

This object represents the paymasters that will be used to pay the gas fees for the transactions.

By default, a maximum of 10 paymasters are shown per page.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

get/v1/paymasters

1curl https://api.openfort.xyz/v1/paymasters \
2  -u "$YOUR_SECRET_KEY:"

Update a paymaster.

Update a paymaster.

This object represents the paymaster that will be used to pay the gas fees of the transactions.

Path Parameters
  • id
    REQUIRED
    string
Body Parameters
  • address
    REQUIRED
    string

    Specifies the address of the paymaster

  • urlstring

    Specifies the paymaster URL

  • contextobject

    Specifies the context, that is, the arbitrary repositories that the specific paymaster may require

  • namestring

    Specifies the name of the paymaster

post/v1/paymasters/{id}

1curl https://api.openfort.xyz/v1/paymasters/{id} \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x7d526b7e99fbf52850a183...'
{
  "id": "pay_f0f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "paymaster",
  "address": "0x7b9f89cf2c18540f4beef2a250d7a472b",
  "url": "https://rpc.mypaymaster.xyz",
  "context": {
    "key": "value"
  },
  "createdAt": 1617226800
}

Get paymaster by id.

Returns the paymaster with the given id.

This object represents the paymaster that will be used to pay the gas fees for the transactions.

Path Parameters
  • id
    REQUIRED
    string
get/v1/paymasters/{id}

1curl https://api.openfort.xyz/v1/paymasters/{id} \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pay_f0f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "paymaster",
  "address": "0x7b9f89cf2c18540f4beef2a250d7a472b",
  "url": "https://rpc.mypaymaster.xyz",
  "context": {
    "key": "value"
  },
  "createdAt": 1617226800
}

Delete paymaster by id.

Delete the paymaster with the given id.

This object represents the paymaster that will be used to pay the gas fees for the transactions.

Path Parameters
  • id
    REQUIRED
    string
delete/v1/paymasters/{id}

1curl https://api.openfort.xyz/v1/paymasters/{id} \
2  -u "$YOUR_SECRET_KEY:"

List players.

By default, a maximum of 10 players are shown.

Returns the latest 10 transaction intents that were created with each player.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • expandarray

    An array with:

    • transactionIntents
    • accounts

    Specifies the fields to expand in the response.

  • namestring

    Filter by player name.

get/v1/players

1curl https://api.openfort.xyz/v1/players \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/players",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "pla_00000000-0000-0000-0000-000000000000",
      "createdAt": 1689869074,
      "object": "player",
      "description": "John Smith",
      "metadata": {
        "firstName": "John",
        "lastName": "Smith"
      },
      "name": "My Player",
      "accounts": [
        {
          "id": "acc_8888888888-8888-8888-8888-888888888888"
        }
      ],
      "transactionIntents": [
        {
          "id": "tin_AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
        }
      ]
    }
  ]
}

Create a player object.

Creates a player.

Body Parameters
  • namestring

    Specifies the player name.

  • descriptionstring

    Specifies the player description.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

post/v1/players

1curl https://api.openfort.xyz/v1/players \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pla_00000000-0000-0000-0000-000000000000",
  "createdAt": 1689869074,
  "object": "player",
  "description": "John Smith",
  "metadata": {
    "firstName": "John",
    "lastName": "Smith"
  },
  "name": "My Player",
  "accounts": [
    {
      "id": "acc_8888888888-8888-8888-8888-888888888888"
    }
  ],
  "transactionIntents": [
    {
      "id": "tin_AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
    }
  ]
}

Retrieves the details of an existing player.

Retrieves the details of a player that has previously been created.

Returns the latest 10 transaction intents that were created with this player.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Query Parameters
  • expandarray

    An array with:

    • transactionIntents
    • accounts

    Specifies the expandable fields.

get/v1/players/{id}

1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pla_00000000-0000-0000-0000-000000000000",
  "createdAt": 1689869074,
  "object": "player",
  "description": "John Smith",
  "metadata": {
    "firstName": "John",
    "lastName": "Smith"
  },
  "name": "My Player",
  "accounts": [
    {
      "id": "acc_8888888888-8888-8888-8888-888888888888"
    }
  ],
  "transactionIntents": [
    {
      "id": "tin_AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
    }
  ]
}

Updates a player object.

Updates the specified player by setting the values of the parameters passed.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Body Parameters
  • namestring

    Specifies the player name.

  • descriptionstring

    Specifies the player description.

  • metadataobject

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

post/v1/players/{id}

1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pla_00000000-0000-0000-0000-000000000000",
  "createdAt": 1689869074,
  "object": "player",
  "description": "John Smith",
  "metadata": {
    "firstName": "John",
    "lastName": "Smith"
  },
  "name": "My Player",
  "accounts": [
    {
      "id": "acc_8888888888-8888-8888-8888-888888888888"
    }
  ],
  "transactionIntents": [
    {
      "id": "tin_AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"
    }
  ]
}

Deletes a player object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

delete/v1/players/{id}

1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pla_00000000-0000-0000-0000-000000000000",
  "object": "player",
  "deleted": true
}

Request transfer ownership of a player.

This endpoint allows you to perform a request to change the owner of an account. To perform an update on the owner of an account, first you must provide a new owner address. Once requested, the owner must accept to take ownership by calling acceptOwnership() in the smart contract account.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Body Parameters
  • policy
    REQUIRED
    string

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). A policy must be provided.

  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • newOwnerAddress
    REQUIRED
    string

    The address of the new owner

  • playerstring

    ID of the Player that has the Account you want to transfer ownership from (starts with pla_).

post/v1/players/{id}/request_transfer_ownership

1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/request_transfer_ownership \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd' \
4  -d 'chainId=80002' \
5  -d 'newOwnerAddress=0x1234567890abcdef1234567890abcdef12345678'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "details": {
    "userOperationHash": "0x25d3...005c",
    "userOperation": {
      "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
      "nonce": "0x2",
      "initCode": "0x",
      "callData": "0xb61d...0000",
      "callGasLimit": "0x27863",
      "verificationGasLimit": "0x16001",
      "preVerificationGas": "0xb818",
      "maxFeePerGas": "0x62590091",
      "maxPriorityFeePerGas": "0x62590091",
      "paymasterAndData": "0x3210...b51c",
      "signature": "0x6202...3d1b"
    }
  },
  "chainId": 80002,
  "abstractionType": "accountAbstractionV6",
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Cancel request to transfer ownership of a player.

This endpoint allows you to cancel a pending transfer of ownership.

Path Parameters
  • id
    REQUIRED
    string
Body Parameters
  • policy
    REQUIRED
    string

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). A policy must be provided.

  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

post/v1/players/{id}/cancel_transfer_ownership

1curl https://api.openfort.xyz/v1/players/{id}/cancel_transfer_ownership \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd' \
4  -d 'chainId=80002'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "details": {
    "userOperationHash": "0x25d3...005c",
    "userOperation": {
      "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
      "nonce": "0x2",
      "initCode": "0x",
      "callData": "0xb61d...0000",
      "callGasLimit": "0x27863",
      "verificationGasLimit": "0x16001",
      "preVerificationGas": "0xb818",
      "maxFeePerGas": "0x62590091",
      "maxPriorityFeePerGas": "0x62590091",
      "paymasterAndData": "0x3210...b51c",
      "signature": "0x6202...3d1b"
    }
  },
  "chainId": 80002,
  "abstractionType": "accountAbstractionV6",
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

List policies.

Returns a list of Policies.

Returns the latest 10 transaction intents for each policy.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • expandarray

    An array with:

    • transactionIntents
    • policyRules

    Specifies the fields to expand in the response.

  • namestring

    Specifies the name of the policy.

  • deletedboolean

    Specifies whether to include deleted policies.

  • chainIdinteger

    The chain ID of the policy.

  • enabledboolean

    Specifies whether to include enabled policies.

get/v1/policies

1curl https://api.openfort.xyz/v1/policies \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/policies",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "pol_...",
      "createdAt": 1689869074,
      "name": "TEST",
      "chainId": 80002,
      "strategy": {
        "sponsorSchema": "pay_for_user"
      },
      "deleted": false,
      "enabled": true,
      "object": "policy",
      "transactionIntents": [
        {
          "id": "tin_..."
        }
      ],
      "policyRules": [
        {
          "createdAt": 1689869074,
          "id": "afu_...",
          "functionName": "mint"
        }
      ]
    }
  ]
}

Create a policy object.

Body Parameters
  • name
    REQUIRED
    string

    Specifies the name of the policy.

  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • strategy
    REQUIRED
    object

    The sponsor schema of the policy.

  • paymasterstring

    The ID of the paymaster.

  • forwarderContractstring

    The ID of the forwarder contract.

post/v1/policies

1curl https://api.openfort.xyz/v1/policies \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'name=My Policy' \
4  -d 'chainId=80002' \
5  -d 'strategy[0][sponsorSchema]=fixed_rate' \
6  -d 'strategy[0][tokenContract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
7  -d 'strategy[0][tokenContractAmount]=1000000000000000000' \
{
  "id": "pol_...",
  "createdAt": 1689869074,
  "name": "TEST",
  "chainId": 80002,
  "strategy": {
    "sponsorSchema": "pay_for_user"
  },
  "deleted": false,
  "enabled": true,
  "object": "policy",
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "policyRules": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "functionName": "mint"
    }
  ]
}

Get a policy object.

Retrieves the details of a Policy that has previously been created.

Returns the latest 10 transaction intents that used this policy.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Query Parameters
  • expandarray

    An array with:

    • transactionIntents
    • policyRules

    Specifies the fields to expand.

get/v1/policies/{id}

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pol_...",
  "createdAt": 1689869074,
  "name": "TEST",
  "chainId": 80002,
  "strategy": {
    "sponsorSchema": "pay_for_user"
  },
  "deleted": false,
  "enabled": true,
  "object": "policy",
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "policyRules": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "functionName": "mint"
    }
  ]
}

Update a policy object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Body Parameters
  • namestring

    Specifies the name of the policy.

  • chainIdinteger

    The chain ID. Must be a supported chain.

  • strategyobject

    The sponsor schema of the policy.

  • paymasterstring

    The ID of the paymaster.

  • forwarderContractstring

    The ID of the forwarder contract.

  • deletedboolean

    Specifies whether to delete the policy.

post/v1/policies/{id}

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pol_...",
  "createdAt": 1689869074,
  "name": "TEST",
  "chainId": 80002,
  "strategy": {
    "sponsorSchema": "pay_for_user"
  },
  "deleted": false,
  "enabled": true,
  "object": "policy",
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "policyRules": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "functionName": "mint"
    }
  ]
}

Delete a policy object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

delete/v1/policies/{id}

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pol_...",
  "deleted": true,
  "object": "policy"
}

Disable a policy object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

put/v1/policies/{id}/disable

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/disable \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pol_...",
  "createdAt": 1689869074,
  "name": "TEST",
  "chainId": 80002,
  "strategy": {
    "sponsorSchema": "pay_for_user"
  },
  "deleted": false,
  "enabled": true,
  "object": "policy",
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "policyRules": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "functionName": "mint"
    }
  ]
}

Enable a policy object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

put/v1/policies/{id}/enable

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/enable \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "pol_...",
  "createdAt": 1689869074,
  "name": "TEST",
  "chainId": 80002,
  "strategy": {
    "sponsorSchema": "pay_for_user"
  },
  "deleted": false,
  "enabled": true,
  "object": "policy",
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "policyRules": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "functionName": "mint"
    }
  ]
}

List all gas reports of a policy.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

get/v1/policies/{id}/reports

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/reports \
2  -u "$YOUR_SECRET_KEY:"
{
  "data": [
    {
      "period": {
        "start": 1690848000,
        "end": 1693526399
      },
      "averageTransactionFee": "0.002721745",
      "totalTransactionFee": "0.00544349",
      "totalTransactionFeeInUSD": "0.00191",
      "totalTransactionFeeInCustomTokens": "0.00122705",
      "transactionIntents": [
        {
          "id": "tin_47eed6b7-...-ce4a602c5f17",
          "gasFee": "0.00421644",
          "gasPrice": "0.34918179665034244",
          "gasUsed": "0.000000000000421644",
          "gasFeeInUSD": "0.00148"
        },
        {
          "id": "tin_6d3b4a95-...-f63927018815",
          "gasFee": "0.00122705",
          "gasPrice": "0.34918179665034244",
          "gasUsed": "0.000000000000122705",
          "gasFeeInUSD": "0.00043"
        }
      ]
    }
  ],
  "start": 0,
  "end": 1,
  "total": 1,
  "url": "/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/reports",
  "object": "list"
}

List transaction intents of a policy report.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Query Parameters
  • to
    REQUIRED
    number

    The start date of the period in unix timestamp.

  • from
    REQUIRED
    number

    The end date of the period in unix timestamp.

get/v1/policies/{id}/reports/transaction_intents

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/reports/transaction_intents \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'to=1612137600' \
4  -d 'from=1612137600'
{
  "data": [
    {
      "id": "tin_47eed6b7-...-ce4a602c5f17",
      "gasFee": "0.00421644",
      "gasPrice": "0.34918179665034244",
      "gasUsed": "0.000000000000421644",
      "gasFeeInUSD": "0.00148"
    },
    {
      "id": "tin_6d3b4a95-...-f63927018815",
      "gasFee": "0.00122705",
      "gasPrice": "0.34918179665034244",
      "gasUsed": "0.000000000000122705",
      "gasFeeInUSD": "0.00043"
    }
  ],
  "start": 0,
  "end": 1,
  "total": 1,
  "url": "/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/reports",
  "object": "list"
}

Get amount of tokens paid for gas policy.

Get the amount of ERC-20 tokens collected by policy.

When using a policy that includes payment of gas in ERC-20 tokens, this endpoint returns the amount of tokens paid for gas. This is specific to a policy that doesn't use your own deposited tokens in the paymaster.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

get/v1/policies/{id}/withdraw

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/withdraw \
2  -u "$YOUR_SECRET_KEY:"
{
  "data": [
    {
      "period": {
        "start": 1690848000,
        "end": 1693526399
      },
      "averageTransactionFee": "0.002721745",
      "totalTransactionFee": "0.00544349",
      "totalTransactionFeeInUSD": "0.00191",
      "totalTransactionFeeInCustomTokens": "0.00122705",
      "transactionIntents": [
        {
          "id": "tin_47eed6b7-...-ce4a602c5f17",
          "gasFee": "0.00421644",
          "gasPrice": "0.34918179665034244",
          "gasUsed": "0.000000000000421644",
          "gasFeeInUSD": "0.00148"
        },
        {
          "id": "tin_6d3b4a95-...-f63927018815",
          "gasFee": "0.00122705",
          "gasPrice": "0.34918179665034244",
          "gasUsed": "0.000000000000122705",
          "gasFeeInUSD": "0.00043"
        }
      ]
    }
  ],
  "start": 0,
  "end": 1,
  "total": 1,
  "url": "/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/reports",
  "object": "list"
}

Withdraw tokens collected by policy.

Transfer ERC-20 tokens collected by policy.

When using a policy that includes payment of gas in ERC-20 tokens, this endpoint returns the amount of tokens paid for gas. This is specific to a policy that doesn't use your own deposited tokens in the paymaster.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Body Parameters
  • account
    REQUIRED
    string

    ID of the Dev Account this TransactionIntent will send the specified amount of tokens to (starts with dac_).

  • amount
    REQUIRED
    string

    Amount in WEI to withdraw (i.e. factor 10^18)..

post/v1/policies/{id}/withdraw

1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/withdraw \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'account=dac_e1b24353-1741-4a3d-9e91-2b0fd2942f60' \
4  -d 'amount=300000'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "details": {
    "userOperationHash": "0x25d3...005c",
    "userOperation": {
      "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
      "nonce": "0x2",
      "initCode": "0x",
      "callData": "0xb61d...0000",
      "callGasLimit": "0x27863",
      "verificationGasLimit": "0x16001",
      "preVerificationGas": "0xb818",
      "maxFeePerGas": "0x62590091",
      "maxPriorityFeePerGas": "0x62590091",
      "paymasterAndData": "0x3210...b51c",
      "signature": "0x6202...3d1b"
    }
  },
  "chainId": 80002,
  "abstractionType": "accountAbstractionV6",
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

List policy rules of a policy.

Returns a list of policy rules of a policy.

The policy rules are returned sorted by creation date, with the most recently created policy rules appearing first.

By default, a maximum of 10 policy rules are shown per page.

Query Parameters
  • policy
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • expandarray

    An array with:

    • contract

    Specifies the fields to expand in the response.

get/v1/policy_rules

1curl https://api.openfort.xyz/v1/policy_rules \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'policy=pol_48eeba57-2cd5-4159-a2cb-057a23a35e65'
{
  "object": "list",
  "url": "/v1/policy_rules",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "wildcard": false,
      "object": "policyRule",
      "type": "contract_functions",
      "contract": {
        "id": "con_..."
      },
      "functionName": "mint"
    }
  ]
}

Create a policy rule object.

Body Parameters
  • type
    REQUIRED
    string

    One of:

    • contract_functions
    • account_functions
    • rate_limit

    The type of rule to add.

  • policy
    REQUIRED
    string

    The unique Policy ID to add the rule to (starts with pol_).

  • functionNamestring

    Name of the function in the contract to allow. If you want to allow all functions, use the wildcard 'All functions'.

  • contractstring

    The contract ID you want to interact with. Must have been added to Openfort first, starts with con_.

  • wildcardboolean

    When using contract_functions type, set this to true to allow all contracts.

  • gasLimitstring

    Gas limit in WEI (i.e. factor 10^18).

  • countLimitinteger

    Number of times the function will be sponsored.

  • timeIntervalTypestring

    One of:

    • minute
    • hour
    • day
    • week
    • month

    Time interval between sponsorships.

  • timeIntervalValueinteger

    Time interval value.

post/v1/policy_rules

1curl https://api.openfort.xyz/v1/policy_rules \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'type=account_functions' \
4  -d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
{
  "createdAt": 1689869074,
  "id": "afu_...",
  "wildcard": false,
  "object": "policyRule",
  "type": "contract_functions",
  "contract": {
    "id": "con_..."
  },
  "functionName": "mint"
}

Update a policy rule object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy rule ID (starts with afu_).

Body Parameters
  • type
    REQUIRED
    string

    One of:

    • contract_functions
    • account_functions
    • rate_limit

    The type of rule to add.

  • functionNamestring

    Name of the function in the contract to allow. If you want to allow all functions, use the wildcard 'All functions'.

  • contractstring

    The contract ID you want to interact with. Must have been added to Openfort first, starts with con_.

  • wildcardboolean

    When using contract_functions type, set this to true to allow all contracts.

  • gasLimitstring

    Gas limit in WEI (i.e. factor 10^18).

  • countLimitinteger

    Number of times the function will be sponsored.

  • timeIntervalTypestring

    One of:

    • minute
    • hour
    • day
    • week
    • month

    Time interval between sponsorships.

  • timeIntervalValueinteger

    Time interval value.

post/v1/policy_rules/{id}

1curl https://api.openfort.xyz/v1/policy_rules/afu_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'type=account_functions'
{
  "createdAt": 1689869074,
  "id": "afu_...",
  "object": "policyRule",
  "type": "rate_limit",
  "functionName": "count_per_interval",
  "countLimit": 100,
  "timeIntervalType": "day",
  "timeIntervalValue": 1
}

Deletes a policy rule object.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy rule ID (starts with afu_).

delete/v1/policy_rules/{id}

1curl https://api.openfort.xyz/v1/policy_rules/afu_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "afu_...",
  "object": "policyRule",
  "deleted": true
}

List session keys of a player.

Returns a list of Sessions.

Returns the latest 10 transaction intents for each session.

Query Parameters
  • player
    REQUIRED
    string

    The player ID (starts with pla_)

  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • expandarray

    An array with:

    • transactionIntents

    Specifies the fields to expand in the response.

get/v1/sessions

1curl https://api.openfort.xyz/v1/sessions \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'player=pla_48eeba57-2cd5-4159-a2cb-057a23a35e65'
{
  "object": "list",
  "url": "/v1/sessions",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "ses_...",
      "createdAt": 1689869074,
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "updatedAt": 1689869074,
      "isActive": true,
      "validAfter": "1650000000",
      "validUntil": "1700000000",
      "whitelist": [],
      "limit": 100,
      "nextAction": {
        "type": "sign_with_wallet",
        "payload": {
          "userOperationHash": "0x25d3...005c",
          "userOperation": {
            "sender": "0x814A...FB72",
            "nonce": "0x0",
            "initCode": "0x",
            "callData": "0xb61d27f6000000000000000",
            "callGasLimit": "0x2e84d",
            "verificationGasLimit": "0x1bcef",
            "maxFeePerGas": "0x62590091",
            "maxPriorityFeePerGas": "0x62590091",
            "paymasterAndData": "0x3210...391b",
            "signature": "",
            "preVerificationGas": "0xb80c"
          }
        }
      },
      "transactionIntents": [
        {
          "id": "tin_..."
        }
      ],
      "object": "session"
    }
  ]
}

Create a session key.

Creates a Session.

Body Parameters
  • address
    REQUIRED
    string

    The address of the session key.

  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • validAfter
    REQUIRED
    integer

    The unix timestamp in seconds when the session key becomes valid.

  • validUntil
    REQUIRED
    integer

    The unix timestamp in seconds when the session key expires.

  • externalOwnerAddressstring

    If no account exists for a given player, create one with this address.

  • limitinteger

    Maximum number of times the session key can be used.

  • optimisticboolean

    Set to true to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

  • policystring

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). If no Policy is provided, the own Account native token funds will be used to pay for gas.

  • whitelistarray

    The list of whitelisted addresses (contracts the session key can interact with).

  • playerstring

    The player ID (starts with pla_).

Query Parameters
  • X-Behalf-Of-Projectstring
post/v1/sessions

1curl https://api.openfort.xyz/v1/sessions \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x1234567890abcdef1234567890abcdef12345678' \
4  -d 'chainId=80002' \
5  -d 'validAfter=10' \
6  -d 'validUntil=123512123'
{
  "id": "ses_...",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "updatedAt": 1689869074,
  "isActive": true,
  "validAfter": "1650000000",
  "validUntil": "1700000000",
  "whitelist": [],
  "limit": 100,
  "nextAction": {
    "type": "sign_with_wallet",
    "payload": {
      "userOperationHash": "0x25d3...005c",
      "userOperation": {
        "sender": "0x814A...FB72",
        "nonce": "0x0",
        "initCode": "0x",
        "callData": "0xb61d27f6000000000000000",
        "callGasLimit": "0x2e84d",
        "verificationGasLimit": "0x1bcef",
        "maxFeePerGas": "0x62590091",
        "maxPriorityFeePerGas": "0x62590091",
        "paymasterAndData": "0x3210...391b",
        "signature": "",
        "preVerificationGas": "0xb80c"
      }
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

Revoke the session session key.

Body Parameters
  • address
    REQUIRED
    string

    The address of the session key to revoke.

  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • player
    REQUIRED
    string

    The player ID (starts with pla_).

  • policystring

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). If no Policy is provided, the own Account native token funds will be used to pay for gas.

  • optimisticboolean

    Whether the transactionIntent is optimistic (resolve before it arrives on chain) or not.

Query Parameters
  • X-Behalf-Of-Projectstring
post/v1/sessions/revoke

1curl https://api.openfort.xyz/v1/sessions/revoke \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x1234567890abcdef1234567890abcdef12345678' \
4  -d 'chainId=80002' \
5  -d 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60'
{
  "id": "ses_...",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "updatedAt": 1689869074,
  "isActive": true,
  "validAfter": "1650000000",
  "validUntil": "1700000000",
  "whitelist": [],
  "limit": 100,
  "nextAction": {
    "type": "sign_with_wallet",
    "payload": {
      "userOperationHash": "0x25d3...005c",
      "userOperation": {
        "sender": "0x814A...FB72",
        "nonce": "0x0",
        "initCode": "0x",
        "callData": "0xb61d27f6000000000000000",
        "callGasLimit": "0x2e84d",
        "verificationGasLimit": "0x1bcef",
        "maxFeePerGas": "0x62590091",
        "maxPriorityFeePerGas": "0x62590091",
        "paymasterAndData": "0x3210...391b",
        "signature": "",
        "preVerificationGas": "0xb80c"
      }
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

Send signed userOperationHash to create session.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique session ID (starts with ses_).

Body Parameters
  • signature
    REQUIRED
    string

    signed userOperationHash by the owner or valid session key

  • optimisticboolean

    Set to true to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

post/v1/sessions/{id}/signature

1curl https://api.openfort.xyz/v1/sessions/ses_4194ad24-c818-4e5c-b003-9cc2aa7df53b/signature \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'signature=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
{
  "id": "ses_...",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "updatedAt": 1689869074,
  "isActive": true,
  "validAfter": "1650000000",
  "validUntil": "1700000000",
  "whitelist": [],
  "limit": 100,
  "nextAction": {
    "type": "sign_with_wallet",
    "payload": {
      "userOperationHash": "0x25d3...005c",
      "userOperation": {
        "sender": "0x814A...FB72",
        "nonce": "0x0",
        "initCode": "0x",
        "callData": "0xb61d27f6000000000000000",
        "callGasLimit": "0x2e84d",
        "verificationGasLimit": "0x1bcef",
        "maxFeePerGas": "0x62590091",
        "maxPriorityFeePerGas": "0x62590091",
        "paymasterAndData": "0x3210...391b",
        "signature": "",
        "preVerificationGas": "0xb80c"
      }
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

Returns a player session by session id

Retrieves the details of a Session that has previously been created.

Returns the latest 10 transaction intents that used this session.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique session ID (starts with ses_).

Query Parameters
  • expandarray

    An array with:

    • transactionIntents

    Specifies the fields to expand.

get/v1/sessions/{id}

1curl https://api.openfort.xyz/v1/sessions/ses_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "ses_...",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "updatedAt": 1689869074,
  "isActive": true,
  "validAfter": "1650000000",
  "validUntil": "1700000000",
  "whitelist": [],
  "limit": 100,
  "nextAction": {
    "type": "sign_with_wallet",
    "payload": {
      "userOperationHash": "0x25d3...005c",
      "userOperation": {
        "sender": "0x814A...FB72",
        "nonce": "0x0",
        "initCode": "0x",
        "callData": "0xb61d27f6000000000000000",
        "callGasLimit": "0x2e84d",
        "verificationGasLimit": "0x1bcef",
        "maxFeePerGas": "0x62590091",
        "maxPriorityFeePerGas": "0x62590091",
        "paymasterAndData": "0x3210...391b",
        "signature": "",
        "preVerificationGas": "0xb80c"
      }
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

List of developer accounts.

Retrieve the list of the developer accounts for the current project.

Returns the latest 10 transaction intents that were created with each developer account.

By default, a maximum of 10 accounts are shown per page.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • expandarray

    An array with:

    • transactionIntents

    Specifies the fields to expand in the response.

  • deletedboolean

    Specifies whether to include deleted dev accounts.

get/v1/settings/developer_accounts

1curl https://api.openfort.xyz/v1/settings/developer_accounts \
2  -u "$YOUR_SECRET_KEY:"
{
  "url": "/v1/settings/developer_accounts",
  "object": "list",
  "data": [
    {
      "id": "dac_00000000-0000-0000-0000-000000000000",
      "address": "0x0000000000000000000000000000000000000000",
      "name": "Escrow Account",
      "custodial": true,
      "createdAt": 1609459200,
      "object": "developerAccount",
      "transactionIntents": [
        {
          "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
        }
      ]
    },
    {
      "id": "dac_88888888-8888-8888-8888-888888888888",
      "address": "0x8888888888888888888888888888888888888888",
      "name": "Escrow Account 2",
      "custodial": true,
      "createdAt": 1609459200,
      "object": "developerAccount"
    }
  ],
  "start": 0,
  "end": 2,
  "total": 2
}

Create a developer account.

Create or add a developer account. Developer accounts can be used as for escrow, minting and transferring assets. To add your own external account, add a signature and the address of the account. This verified account can then be used as a verified depositor

Body Parameters
  • addressstring

    The address of the wallet that has deposited funds in the paymaster.

  • signaturestring

    Signature to verify the account ownership.

  • namestring

    The name of the account.

post/v1/settings/developer_accounts

1curl https://api.openfort.xyz/v1/settings/developer_accounts \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "dac_00000000-0000-0000-0000-000000000000",
  "address": "0x0000000000000000000000000000000000000000",
  "name": "Escrow Account",
  "custodial": true,
  "createdAt": 1609459200,
  "object": "developerAccount",
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Update a developer account.

Update a developer account.

Path Parameters
  • id
    REQUIRED
    string
Body Parameters
  • namestring

    The name of the account.

post/v1/settings/developer_accounts/{id}

1curl https://api.openfort.xyz/v1/settings/developer_accounts/{id} \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "dac_00000000-0000-0000-0000-000000000000",
  "address": "0x0000000000000000000000000000000000000000",
  "name": "Escrow Account",
  "custodial": true,
  "createdAt": 1609459200,
  "object": "developerAccount",
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Get existing developer account.

Retrieve a developer account.

Returns the latest 10 transaction intents that were created with each developer account.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique developer account ID (starts with dac_).

Query Parameters
  • expandarray

    An array with:

    • transactionIntents
get/v1/settings/developer_accounts/{id}

1curl https://api.openfort.xyz/v1/settings/developer_accounts/dac_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "dac_00000000-0000-0000-0000-000000000000",
  "address": "0x0000000000000000000000000000000000000000",
  "name": "Escrow Account",
  "custodial": true,
  "createdAt": 1609459200,
  "object": "developerAccount",
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Delete a developer account.

Delete a developer account from the current project.

Path Parameters
  • id
    REQUIRED
    string

    Specifies a unique developer account (starts with dac_).

delete/v1/settings/developer_accounts/{id}

1curl https://api.openfort.xyz/v1/settings/developer_accounts/dac_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "dac_00000000-0000-0000-0000-000000000000",
  "object": "developerAccount",
  "deleted": true
}

Generate message to sign

Generate message, which should be signed by the account your want to add as a developer account.

Query Parameters
  • address
    REQUIRED
    string

    Specifies the address

get/v1/settings/developer_accounts/message_to_sign

1curl https://api.openfort.xyz/v1/settings/developer_accounts/message_to_sign \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
{
  "message": "I want to register 0x0000000000000000000000000000000000000000 to the project 33333333-3333-3333-3333-333333333333 for mainnets on 20231231",
  "address": "0x0000000000000000000000000000000000000000"
}

List subscriptions of project.

Returns a list of subscriptions for the given project.

This object represents the subscriptions where the project owner has subscribed to.

Subscriptions are returned sorted by creation date, with the most recently created subscriptions appearing first.

By default, a maximum of 10 subscriptions are shown per page.

get/v1/subscriptions

1curl https://api.openfort.xyz/v1/subscriptions \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/subscriptions",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "object": "subscription",
      "topic": "transaction_intent.broadcast",
      "triggers": [
        {
          "id": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
          "object": "trigger",
          "target": "https://webhook.site/7b9f89cf2-c185-40f4-beef-2a250d7a472b",
          "type": "webhook",
          "createdAt": 1617226800,
          "subscription": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
          "updatedAt": 1617226800
        }
      ],
      "createdAt": 1617226800,
      "updatedAt": 1617226800
    }
  ]
}

Create subscription for project.

Creates a subscription for the given project.

This object represents the subscription where the project owner has subscribed to.

Body Parameters
  • topic
    REQUIRED
    string

    One of:

    • transaction_intent.broadcast
    • transaction_intent.successful
    • transaction_intent.cancelled
    • transaction_intent.failed
    • balance.project
    • balance.contract
    • balance.dev_account
    • test

    Specifies the topic of the subscription

  • triggers
    REQUIRED
    array

    Specifies the triggers of the subscription

post/v1/subscriptions

1curl https://api.openfort.xyz/v1/subscriptions \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'topic=transaction.broadcast' \
4  -d 'triggers[0][target]=https://example.com' \
5  -d 'triggers[0][type]=webhook' \
6  -d 'triggers[0][subscription]=sub_6f6c9067-89fa-4fc8-ac72-c242a268c584'
{
  "id": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "subscription",
  "topic": "transaction_intent.broadcast",
  "triggers": [
    {
      "id": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "object": "trigger",
      "target": "https://webhook.site/7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "type": "webhook",
      "createdAt": 1617226800,
      "subscription": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "updatedAt": 1617226800
    }
  ],
  "createdAt": 1617226800,
  "updatedAt": 1617226800
}

List logs of triggered subscriptions.

Lists logs of the triggered subscriptions for the given project.

This object represents the logs of the triggered subscriptions where the project owner has subscribed to.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • topicstring

    One of:

    • transaction_intent.broadcast
    • transaction_intent.successful
    • transaction_intent.cancelled
    • transaction_intent.failed
    • balance.project
    • balance.contract
    • balance.dev_account
    • test

    Specifies the topic of the subscription logs

  • statusstring

    One of:

    • success
    • failed

    Specifies the status of the subscription logs

  • objectstring

    Specifies the object ID of the object related to triggered notification

  • subscriptionstring

    Specifies the subscription ID

  • triggerstring

    Specifies the trigger ID

  • requestIDstring

    Specifies the request ID

get/v1/subscriptions/logs

1curl https://api.openfort.xyz/v1/subscriptions/logs \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/subscriptions/logs",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "eve_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "object": "log",
      "topic": "transaction_intent.broadcast",
      "status": "success",
      "createdAt": 1617226800,
      "subscription": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "trigger": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "requestID": "c1852a250d7a472b"
    }
  ]
}

Get subscription of project.

Returns a subscription for the given project.

This object represents the subscription where the project owner has subscribed to.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

get/v1/subscriptions/{id}

1curl https://api.openfort.xyz/v1/subscriptions/sub_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "subscription",
  "topic": "transaction_intent.broadcast",
  "triggers": [
    {
      "id": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "object": "trigger",
      "target": "https://webhook.site/7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "type": "webhook",
      "createdAt": 1617226800,
      "subscription": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "updatedAt": 1617226800
    }
  ],
  "createdAt": 1617226800,
  "updatedAt": 1617226800
}

Delete subscription of project.

Deletes a subscription for the given project.

This object represents the subscription where the project owner has subscribed to.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

delete/v1/subscriptions/{id}

1curl https://api.openfort.xyz/v1/subscriptions/sub_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
2  -u "$YOUR_SECRET_KEY:"
{
  "deleted": true,
  "id": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "subscription"
}

List triggers of subscription.

Returns a list of triggers for the given subscription.

This object represents the triggers where the subscription owner has subscribed to.

Triggers are returned sorted by creation date, with the most recently created triggers appearing first.

By default, a maximum of 10 triggers are shown per page.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

get/v1/subscriptions/{id}/triggers

1curl https://api.openfort.xyz/v1/subscriptions/sub_4194ad24-c818-4e5c-b003-9cc2aa7df53b/triggers \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "v1/triggers",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "object": "trigger",
      "target": "https://webhook.site/7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "type": "webhook",
      "createdAt": 1617226800,
      "subscription": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
      "updatedAt": 1617226800
    }
  ]
}

Create trigger for subscription.

Creates a trigger for the given subscription.

This object represents the trigger where the subscription owner has subscribed to.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

Body Parameters
  • target
    REQUIRED
    string

    Specifies the target of the trigger

  • type
    REQUIRED
    string

    One of:

    • webhook
    • email

    Specifies the type of the trigger

  • subscriptionstring

    Specifies the subscription ID

post/v1/subscriptions/{id}/triggers

1curl https://api.openfort.xyz/v1/subscriptions/sub_4194ad24-c818-4e5c-b003-9cc2aa7df53b/triggers \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'target=https://example.com' \
4  -d 'type=webhook'
{
  "id": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "trigger",
  "target": "https://webhook.site/7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "type": "webhook",
  "createdAt": 1617226800,
  "subscription": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "updatedAt": 1617226800
}

Get trigger by id.

Returns a trigger for the given id.

This object represents the trigger where the subscription owner has subscribed to.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

  • triggerId
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

get/v1/subscriptions/{id}/triggers/{triggerId}

1curl https://api.openfort.xyz/v1/subscriptions/sub_4194ad24-c818-4e5c-b003-9cc2aa7df53b/triggers/tri_6194ad12-a213-1e5c-b003-8040fa3c9c48 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "trigger",
  "target": "https://webhook.site/7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "type": "webhook",
  "createdAt": 1617226800,
  "subscription": "sub_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "updatedAt": 1617226800
}

Delete trigger of subscription.

Deletes a trigger for the given subscription.

This object represents the trigger where the subscription owner has subscribed to.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

  • triggerId
    REQUIRED
    string

    Specifies the unique subscription ID (starts with sub_).

delete/v1/subscriptions/{id}/triggers/{triggerId}

1curl https://api.openfort.xyz/v1/subscriptions/sub_4194ad24-c818-4e5c-b003-9cc2aa7df53b/triggers/tri_6194ad12-a213-1e5c-b003-8040fa3c9c48 \
2  -u "$YOUR_SECRET_KEY:"
{
  "deleted": true,
  "id": "tri_7b9f89cf2-c185-40f4-beef-2a250d7a472b",
  "object": "trigger"
}

Test trigger by id.

Test a trigger

Returns a trigger for the given id.

post/v1/subscriptions/test

1curl https://api.openfort.xyz/v1/subscriptions/test \
2  -u "$YOUR_SECRET_KEY:"

List transaction intents.

Returns a list of TransactionIntents.

Query Parameters
  • limitinteger

    Specifies the maximum number of records to return.

  • skipinteger

    Specifies the offset for the first records to return.

  • orderstring

    One of:

    • asc
    • desc

    Specifies the order in which to sort the results.

  • expandarray

    An array with:

    • player
    • policy
    • account

    Specifies the fields to expand in the response.

  • chainIdinteger

    The chain ID. Must be a supported chain.

  • accountarray

    Filter by account ID or developer account (starts with acc_ or dac_ respectively).

  • playerarray

    Filter by player ID (starts with pla_).

  • statusnumber

    Filter by successful (1) or failed (0) transaction intents.

  • policyarray

    Filter by policy ID (starts with pol_).

get/v1/transaction_intents

1curl https://api.openfort.xyz/v1/transaction_intents \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/transaction_intents",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
      "createdAt": 1689869074,
      "object": "transactionIntent",
      "details": {
        "userOperationHash": "0x25d3...005c",
        "userOperation": {
          "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
          "nonce": "0x2",
          "initCode": "0x",
          "callData": "0xb61d...0000",
          "callGasLimit": "0x27863",
          "verificationGasLimit": "0x16001",
          "preVerificationGas": "0xb818",
          "maxFeePerGas": "0x62590091",
          "maxPriorityFeePerGas": "0x62590091",
          "paymasterAndData": "0x3210...b51c",
          "signature": "0x6202...3d1b"
        }
      },
      "chainId": 80002,
      "abstractionType": "accountAbstractionV6",
      "updatedAt": 1689869074,
      "policy": {
        "id": "pol_..."
      },
      "player": {
        "id": "pla_..."
      },
      "account": {
        "id": "acc_..."
      },
      "response": {
        "createdAt": 1689869074,
        "logs": [
          {
            "removed": false,
            "transactionIndex": 0,
            "blockNumber": 44904492,
            "transactionHash": "0x25d3...005c",
            "address": "0x5FF1...2789",
            "topics": [
              "0xbb47...f972"
            ],
            "data": "0x",
            "logIndex": 0,
            "blockHash": "0x8a69...6d59"
          }
        ],
        "blockNumber": 8789286,
        "transactionHash": "0x25d3...005c",
        "to": "0x0576...1B57",
        "gasUsed": "336730",
        "status": 1
      },
      "interactions": [
        {
          "functionName": "mint",
          "contract": "con_...",
          "functionArgs": [
            "0x63B7...484f"
          ]
        }
      ]
    }
  ]
}

Create a transaction intent object.

Creates a TransactionIntent.

A pending TransactionIntent has the response attribute as undefined.

After the TransactionIntent is created and broadcasted to the blockchain, response will be populated with the transaction hash and a status (1 success, 0 fail).

When using a non-custodial account, a nextAction attribute is returned with the userOperationHash that must be signed by the owner of the account.

Body Parameters
  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • interactions
    REQUIRED
    array
  • playerstring

    ID of the Player this TransactionIntent belongs to, if one exists (starts with pla_).

    If you omit this parameter a new Player will be created.

  • accountstring

    ID of the Account this TransactionIntent is executed with, if one exists (starts with acc_ or dac_).

    When providing a Player and ChainID, you can omit this parameter.

  • policystring

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). If no Policy is provided, the own Account native token funds will be used to pay for gas.

  • externalOwnerAddressstring

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

    If you omit this parameter and no Account exists for the Player, a custodial Account will be created.

  • optimisticboolean

    Set to true to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

Query Parameters
  • X-Behalf-Of-Projectstring
post/v1/transaction_intents

1curl https://api.openfort.xyz/v1/transaction_intents \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002' \
4  -d 'interactions[0][contract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
5  -d 'interactions[0][functionName]=mint' \
6  -d 'interactions[0][functionArgs][0]=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "details": {
    "userOperationHash": "0x25d3...005c",
    "userOperation": {
      "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
      "nonce": "0x2",
      "initCode": "0x",
      "callData": "0xb61d...0000",
      "callGasLimit": "0x27863",
      "verificationGasLimit": "0x16001",
      "preVerificationGas": "0xb818",
      "maxFeePerGas": "0x62590091",
      "maxPriorityFeePerGas": "0x62590091",
      "paymasterAndData": "0x3210...b51c",
      "signature": "0x6202...3d1b"
    }
  },
  "chainId": 80002,
  "abstractionType": "accountAbstractionV6",
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Get a transaction intent object.

Retrieves the details of a TransactionIntent that has previously been created.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique transaction intent ID (starts with tin_).

Query Parameters
  • expandarray

    An array with:

    • player
    • policy
    • account

    Specifies the expandable fields.

get/v1/transaction_intents/{id}

1curl https://api.openfort.xyz/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "details": {
    "userOperationHash": "0x25d3...005c",
    "userOperation": {
      "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
      "nonce": "0x2",
      "initCode": "0x",
      "callData": "0xb61d...0000",
      "callGasLimit": "0x27863",
      "verificationGasLimit": "0x16001",
      "preVerificationGas": "0xb818",
      "maxFeePerGas": "0x62590091",
      "maxPriorityFeePerGas": "0x62590091",
      "paymasterAndData": "0x3210...b51c",
      "signature": "0x6202...3d1b"
    }
  },
  "chainId": 80002,
  "abstractionType": "accountAbstractionV6",
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Estimate gas cost of creating a transaction

Estimate the gas cost of broadcasting a TransactionIntent.

This is a simulation, it does not send the transaction on-chain.

If a Policy ID is used that includes payment of gas in ERC-20 tokens, an extra field estimatedTXGasFeeToken is returned with the estimated amount of tokens that will be used.

Body Parameters
  • chainId
    REQUIRED
    integer

    The chain ID. Must be a supported chain.

  • interactions
    REQUIRED
    array
  • playerstring

    ID of the Player this TransactionIntent belongs to, if one exists (starts with pla_).

    If you omit this parameter a new Player will be created.

  • accountstring

    ID of the Account this TransactionIntent is executed with, if one exists (starts with acc_ or dac_).

    When providing a Player and ChainID, you can omit this parameter.

  • policystring

    ID of the Policy that defines the gas sponsorship strategy (starts with pol_). If no Policy is provided, the own Account native token funds will be used to pay for gas.

  • externalOwnerAddressstring

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

    If you omit this parameter and no Account exists for the Player, a custodial Account will be created.

  • optimisticboolean

    Set to true to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

post/v1/transaction_intents/estimate_gas_cost

1curl https://api.openfort.xyz/v1/transaction_intents/estimate_gas_cost \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80002' \
4  -d 'interactions[0][contract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
5  -d 'interactions[0][functionName]=mint' \
6  -d 'interactions[0][functionArgs][0]=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
{
  "preVerificationGas": "55637",
  "verificationGas": "375974",
  "callGasLimit": "79646",
  "verificationGasLimit": "375974",
  "estimatedTXGas": "444793",
  "estimatedTXGasFee": "1162163748854053",
  "estimatedTXGasFeeUSD": "0.01",
  "gasPrice": "2612819331"
}

Send a signed transaction signableHash.

Broadcasts a signed TransactionIntent to the blockchain.

Use this endpoint to send the signed signableHash. Openfort will then put it on-chain.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique transaction intent ID (starts with tin_).

Body Parameters
  • signature
    REQUIRED
    string

    signed userOperationHash by the owner or valid session key

  • optimisticboolean

    Set to true to indicate that the transactionIntent request should be resolved as soon as possible, after the transactionIntent is created and simulated and before it arrives on chain.

post/v1/transaction_intents/{id}/signature

1curl https://api.openfort.xyz/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65/signature \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'signature=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "details": {
    "userOperationHash": "0x25d3...005c",
    "userOperation": {
      "sender": "0x48930Cd730652bf0B18Ef8c80cD0Fa1Cc72A233E",
      "nonce": "0x2",
      "initCode": "0x",
      "callData": "0xb61d...0000",
      "callGasLimit": "0x27863",
      "verificationGasLimit": "0x16001",
      "preVerificationGas": "0xb818",
      "maxFeePerGas": "0x62590091",
      "maxPriorityFeePerGas": "0x62590091",
      "paymasterAndData": "0x3210...b51c",
      "signature": "0x6202...3d1b"
    }
  },
  "chainId": 80002,
  "abstractionType": "accountAbstractionV6",
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [
      {
        "removed": false,
        "transactionIndex": 0,
        "blockNumber": 44904492,
        "transactionHash": "0x25d3...005c",
        "address": "0x5FF1...2789",
        "topics": [
          "0xbb47...f972"
        ],
        "data": "0x",
        "logIndex": 0,
        "blockHash": "0x8a69...6d59"
      }
    ],
    "blockNumber": 8789286,
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": "336730",
    "status": 1
  },
  "interactions": [
    {
      "functionName": "mint",
      "contract": "con_...",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}