Home

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": 80001,
_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.

Sign up a player.

When using Openfort Auth, the endpoint creates a player based on his email, and returns the jwt token for the player together with the player id.

Body Parameters
  • email
    REQUIRED
    string

    The email address of the user.

  • password
    REQUIRED
    string

    The password of the user.

  • name
    REQUIRED
    string

    The name of the user.

post/iam/v1/auth/signup
1curl https://api.openfort.xyz/iam/v1/auth/signup \
2  -u "$YOUR_PUBLIC_KEY:" \
3  -d 'email=user@email.com' \
4  -d 'password=password' \
5  -d 'name=John Doe'

Login a player.

When using Openfort Auth, the endpoint authenticates the player based on his email, and returns the jwt token for the player together with the player id.

Body Parameters
  • email
    REQUIRED
    string

    The email address of the user.

  • password
    REQUIRED
    string

    The password of the user.

post/iam/v1/auth/login
1curl https://api.openfort.xyz/iam/v1/auth/login \
2  -u "$YOUR_PUBLIC_KEY:" \
3  -d 'email=user@email.com' \
4  -d 'password=password'

Verify an auth token.

When using Openfort Auth, the endpoint verifies the token generated by Openfort Auth and retrieves a corresponding player.

Query Parameters
  • token
    REQUIRED
    string

    Specifies the auth token.

get/iam/v1/auth/verify
1curl https://api.openfort.xyz/iam/v1/auth/verify \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9qZWN0SWQiOiJwcm9qZWN0XzQ4ZWViYTU3LTJjZDUtNDE1OS1hMmNiLTA1N2EyM2EzNWU2NSIsInVzZXJJZCI6InVzZXJfNDhlZWI1Ny0yY2Q1LTQxNTktYTJjYi0wNTdhMjNhMzVlNjUiLCJpYXQiOjE2MjY0NjY0NzcsImV4cCI6MTYyN'

List authenticated players.

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.

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",
      "player": {
        "id": "pla_ff54b031-a878-4ca2-9cf5-ae190f921e9b"
      },
      "provider": "email",
      "createdAt": 1691658234,
      "updatedAt": 1691658234,
      "email": "jaume@openfort.xyz"
    }
  ]
}

Register a key for the authenticated player.

Body Parameters
  • pk_ciphertext
    REQUIRED
    string

    The cipher text of the key to register.

  • salt
    REQUIRED
    string

    The salt used expand the password of the user.

  • owner_address
    REQUIRED
    string

    The address of the owner.

post/iam/v1/players/register_key
1curl https://api.openfort.xyz/iam/v1/players/register_key \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'pk_ciphertext=0xe12fa94af9dac83ab16fa151043c9aa6084929898b27752e56a03173292a6e5d194455ee2e5dfa443c67d02b323a29f6b5aa0a7b538982da4b649bf7759e5c7c1c' \
4  -d 'salt=0xe12fa94af9dac83ab16fa151043c9aa6084929898b27752e56a03173292a6e5d194455ee2e5dfa443c67d02b323a29f6b5aa0a7b538982da4b649bf7759e5c7c1c' \
5  -d 'owner_address=0x1234567890abcdef1234567890abcdef12345678'
{
  "player": "pla_...",
  "ownerAddress": "0x...",
  "createdAt": 1691658234,
  "updatedAt": 1691658234
}

Retrieve the key for the authenticated player.

get/iam/v1/players/retrieve_key
1curl https://api.openfort.xyz/iam/v1/players/retrieve_key \
2  -u "$YOUR_SECRET_KEY:"
{
  "player": "pla_...",
  "ownerAddress": "0x...",
  "salt": "0x...",
  "pkCiphertext": "0x...",
  "createdAt": 1691658234,
  "updatedAt": 1691658234
}

Get the google oauth signin url.

get/iam/v1/oauth/google/signin_url
1curl https://api.openfort.xyz/iam/v1/oauth/google/signin_url \
2  -u "$YOUR_PUBLIC_KEY:"

Get the google oauth token.

Query Parameters
  • key
    REQUIRED
    string

    Specifies the oauth key.

get/iam/v1/oauth/google/token
1curl https://api.openfort.xyz/iam/v1/oauth/google/token \
2  -u "$YOUR_PUBLIC_KEY:" \

List of oauth configurations.

The endpoint retrieves the list of oauth configurations 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/oauth
1curl https://api.openfort.xyz/iam/v1/oauth \
2  -u "$YOUR_SECRET_KEY:"
{
  "enabled": true,
  "baseUrl": "https://mygame.dev.gamingservices.accelbyte.io/",
  "clientId": "1234567890abcdef1234567890abcdef",
  "clientSecret": "abcdef1234567890abcdef1234567890",
  "provider": "accelbyte"
}

Get oauth configuration.

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

Path Parameters
  • provider
    REQUIRED
    string

    One of:

    accelbyte

    firebase

    google

    lootlocker

    playfab

    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.

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

Path Parameters
  • provider
    REQUIRED
    string

    One of:

    accelbyte

    firebase

    google

    lootlocker

    playfab

    Specifies the oauth provider type.

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

Authorize player with token.

The endpoint verifies the token generated by OAuth provider, creates or retrieves a player based on his email, and returns the jwt token for the player together with the player id.

Path Parameters
  • provider
    REQUIRED
    string

    One of:

    accelbyte

    firebase

    google

    lootlocker

    playfab

    OAuth provider

Body Parameters
  • token
    REQUIRED
    string

    Access token to be verified

post/iam/v1/oauth/{provider}/authorize
1curl https://api.openfort.xyz/iam/v1/oauth/{provider}/authorize \
2  -u "$YOUR_PUBLIC_KEY:" \
3  -d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'
{
  "playerId": "pla_...",
  "token": "abcd...."
}

Retrieve player by token.

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

Path Parameters
  • provider
    REQUIRED
    string

    One of:

    accelbyte

    firebase

    google

    lootlocker

    playfab

    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_PUBLIC_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"
    }
  ]
}

Retrieve player by external id.

Retrieves the player based on his id in the external provider system.

Path Parameters
  • provider
    REQUIRED
    string

    One of:

    accelbyte

    firebase

    google

    lootlocker

    playfab

    OAuth provider

  • external_user_id
    REQUIRED
    string

    External user id

get/iam/v1/oauth/{provider}/user/{external_user_id}
1curl https://api.openfort.xyz/iam/v1/oauth/{provider}/user/1234567890 \
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"
    }
  ]
}

List accounts of a player.

Returns a list of accounts for the given player. The accounts are returned sorted by creation date, with the most recently created accounts appearing first. By default, a maximum of ten 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.

  • player
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_)

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": 5,
      "deployed": true,
      "custodial": false,
      "object": "account",
      "accountType": "Recoverable_v05",
      "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "transactionIntents": [
        {
          "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
        }
      ]
    }
  ]
}

Create an account object.

This endpoint allows you to add a new account to your Openfort player. Only one account can be active per chain per player.

Body Parameters
  • chainId
    REQUIRED
    integer

    The chain id

  • player
    REQUIRED
    string

    The player ID (starts with pla_)

post/v1/accounts
1curl https://api.openfort.xyz/v1/accounts \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80001' \
4  -d 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60'
{
  "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 5,
  "deployed": true,
  "custodial": false,
  "object": "account",
  "accountType": "Recoverable_v05",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "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.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

Query Parameters
  • expandarray

    An array with:

    transactionIntents

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": 5,
  "deployed": true,
  "custodial": false,
  "object": "account",
  "accountType": "Recoverable_v05",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Request transfer ownership of account.

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 account ID.

Body Parameters
  • newOwnerAddress
    REQUIRED
    string

    The address of the new owner

  • policy
    REQUIRED
    string

    The policy ID (starts with pol_)

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",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Cancel request to transfer ownership of an account.

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

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID.

Body Parameters
  • policy
    REQUIRED
    string

    The policy ID (starts with pol_)

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",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Sign a given payload

Signs the typed data value with types data structure for domain using the EIP-712 specification.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID.

Body Parameters
  • domain
    REQUIRED
    object

    Domain. Specific to the dApp.

  • types
    REQUIRED
    object
  • primaryType
    REQUIRED
    string
  • value
    REQUIRED
    object
  • hash
    REQUIRED
    string

    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]=80001' \
4  -d 'primaryType=OrderComponents' \
5  -d 'hash=0xa8ef67af8361fc7f8cf9ba962074418e8cd9233a78237e1c83b1305405d92858'
{
  "account": "acc_...",
  "hash": "0x25d3...005c",
  "object": "signature",
  "signature": "0x25d3...005c",
  "address": "0x8C5cedA46A2...36Ad2F6255BdBEa"
}

Sync account state with the blockchain

This endpoint updates 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": 5,
  "deployed": true,
  "custodial": false,
  "object": "account",
  "accountType": "Recoverable_v05",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

Deploy an account.

This endpoint can be used to deploy an 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": 5,
  "deployed": true,
  "custodial": false,
  "object": "account",
  "accountType": "Recoverable_v05",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "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",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "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_)

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",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "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": 5,
      "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.

  • address
    REQUIRED
    string

    Specifies the address of the contract.

post/v1/contracts
1curl https://api.openfort.xyz/v1/contracts \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'name=NFT Contract' \
4  -d 'chainId=80001' \
5  -d 'address=0x742e6e61d760164d56f44801054bcf40fa821d97'
{
  "id": "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "object": "contract",
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 5,
  "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": 5,
  "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_).

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": 5,
  "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 data.

Using this endpoint, you can get the data 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"
  }
}

Get inventory of player.

Deprecated
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
1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/inventory \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80001'
{
  "object": "inventory",
  "nativeAsset": {
    "assetType": 1,
    "amount": "1000000000000000000",
    "lastTransferredAt": 1689869074
  },
  "nftAssets": [
    {
      "assetType": 2,
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "tokenId": 1,
      "lastTransferredAt": 1689869074
    }
  ],
  "tokenAssets": [
    {
      "assetType": 3,
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "tokenId": 1,
      "amount": "1000000000000000000",
      "lastTransferredAt": 1689869074
    }
  ]
}

Get NFTs list of player.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

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

    Filter by contract ID (starts with con_).

  • chainId
    REQUIRED
    integer

    Filter by chain id.

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=80001'
{
  "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.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

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

    Filter by contract ID (starts with con_).

  • chainId
    REQUIRED
    integer

    Filter by chain id.

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=80001'
{
  "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.

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=80001'
{
  "object": "inventory",
  "url": "/v1/players/pla_.../inventory/native",
  "data": {
    "assetType": "ETH",
    "amount": "1000000000000000000",
    "lastTransferredAt": 1689869074
  }
}

Get inventory of account.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique account ID (starts with acc_).

get/v1/accounts/{id}/inventory
1curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/inventory \
2  -u "$YOUR_SECRET_KEY:"

Retrieves the NFT assets of an existing account.

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.

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.

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
  }
}

List players.

By default, a maximum of ten players 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.

  • 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.

Add a new player to your player list in Openfort.

Body Parameters
  • name
    REQUIRED
    string

    Specifies the player name.

post/v1/players
1curl https://api.openfort.xyz/v1/players \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'name=John'
{
  "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.

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.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

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

    The policy ID (starts with pol_)

  • chainId
    REQUIRED
    integer

    The chain id where the account is.

  • newOwnerAddress
    REQUIRED
    string

    The address of the new owner

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=80001' \
5  -d 'newOwnerAddress=0x1234567890abcdef1234567890abcdef12345678'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "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

    The policy ID (starts with pol_)

  • chainId
    REQUIRED
    integer

    The chain id where the account is.

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=80001'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Create session object for a player.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Body Parameters
  • address
    REQUIRED
    string

    The address of the session key.

  • chainId
    REQUIRED
    integer

    The chain ID.

  • 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.

post/v1/players/{id}/sessions
1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/sessions \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x1234567890abcdef1234567890abcdef12345678' \
4  -d 'chainId=80001' \
5  -d 'validAfter=10' \
6  -d 'validUntil=12351235123'
{
  "id": "ses_...",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "updatedAt": 1689869074,
  "isActive": true,
  "validAfter": "1650000000",
  "validUntil": "1700000000",
  "whitelist": [],
  "limit": 100,
  "nextAction": {
    "type": "sign_with_wallet",
    "payload": {
      "userOpHash": "0x..."
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

Revoke session object for a player.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Body Parameters
  • address
    REQUIRED
    string

    The address of the session key to revoke.

  • chainId
    REQUIRED
    integer

    The chain ID.

post/v1/players/{id}/sessions/revoke
1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/sessions/revoke \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x1234567890abcdef1234567890abcdef12345678' \
4  -d 'chainId=80001'
{
  "id": "ses_...",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "updatedAt": 1689869074,
  "isActive": true,
  "validAfter": "1650000000",
  "validUntil": "1700000000",
  "whitelist": [],
  "limit": 100,
  "nextAction": {
    "type": "sign_with_wallet",
    "payload": {
      "userOpHash": "0x..."
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

List of accounts of a player.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Query Parameters
  • expandarray

    An array with:

    transactionIntents

    Specifies the expandable fields.

get/v1/players/{id}/accounts
1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/accounts \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/accounts",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
      "createdAt": 1689869074,
      "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "chainId": 5,
      "deployed": true,
      "custodial": false,
      "object": "account",
      "accountType": "Recoverable_v05",
      "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
      "transactionIntents": [
        {
          "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
        }
      ]
    }
  ]
}

Create account object for a player.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique player ID (starts with pla_).

Body Parameters
  • chainId
    REQUIRED
    integer

    The chain id

post/v1/players/{id}/accounts
1curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/accounts \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'chainId=80001'
{
  "id": "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a",
  "createdAt": 1689869074,
  "address": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "chainId": 5,
  "deployed": true,
  "custodial": false,
  "object": "account",
  "accountType": "Recoverable_v05",
  "ownerAddress": "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa",
  "transactionIntents": [
    {
      "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a"
    }
  ]
}

List policies.

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 contracts.

  • chainIdinteger

    The chain ID of the policy.

  • enabledboolean

    Specifies whether to include enabled contracts.

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": 5,
      "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 of the policy.

  • strategy
    REQUIRED
    object

    The sponsor schema of the policy.

post/v1/policies
1curl https://api.openfort.xyz/v1/policies \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'name=My Policy' \
4  -d 'chainId=80001' \
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": 5,
  "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.

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": 5,
  "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_).

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": 5,
  "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": 5,
  "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": 5,
  "strategy": {
    "sponsorSchema": "pay_for_user"
  },
  "deleted": false,
  "enabled": true,
  "object": "policy",
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "policyRules": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "functionName": "mint"
    }
  ]
}

List policy rules of a policy.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Query Parameters
  • expandarray

    An array with:

    contract

    Specifies the fields to expand.

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

Create a policy rule object for a policy.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Body Parameters
  • type
    REQUIRED
    string

    One of:

    contract_functions

    account_functions

    rate_limit

    The type of rule to add.

post/v1/policies/{id}/policy_rules
1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/policy_rules \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'type=account_functions'
{
  "createdAt": 1689869074,
  "id": "afu_...",
  "object": "policyRule",
  "type": "contract_functions",
  "contract": {
    "id": "con_..."
  },
  "functionName": "mint"
}

Update a policy rule object of a policy.

Deprecated
Path Parameters
  • policy
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

  • policy_rule
    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.

post/v1/policies/{policy}/policy_rules/{policy_rule}
1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/policy_rules/afu_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
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
}

List all gas reports of a policy.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

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": [
    {
      "periodNumber": 0,
      "period": {
        "start": 1690848000,
        "end": 1693526399
      },
      "averageTransactionFee": "0.002721745",
      "totalTransactionFee": "0.00544349",
      "totalTransactionFeeInUSD": "0.00191",
      "transactionIntents": [
        {
          "transactionIntentId": "tin_47eed6b7-273c-480e-b5eb-ce4a602c5f17",
          "gasFee": "0.00421644",
          "gasPrice": "0.34918179665034244",
          "gasUsed": "0.000000000000421644",
          "gasFeeInUSD": "0.00148"
        },
        {
          "transactionIntentId": "tin_6d3b4a95-fb49-47b0-92f9-f63927018815",
          "gasFee": "0.00122705",
          "gasPrice": "0.34918179665034244",
          "gasUsed": "0.000000000000122705",
          "gasFeeInUSD": "0.00043"
        }
      ]
    }
  ],
  "object": "list"
}

List policy rules of a policy.

Deprecated
Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique policy ID (starts with pol_).

Query Parameters
  • expandarray

    An array with:

    contract

    Specifies the fields to expand.

get/v1/policies/{id}/policy_rules
1curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/policy_rules \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/policy_rules",
  "start": 0,
  "end": 1,
  "total": 1,
  "data": [
    {
      "createdAt": 1689869074,
      "id": "afu_...",
      "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_).

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_...",
  "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.

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
}

Create a session key.

Body Parameters
  • address
    REQUIRED
    string

    The address of the session key.

  • chainId
    REQUIRED
    integer

    The chain ID.

  • 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.

  • player
    REQUIRED
    string

    The player ID (starts with pla_).

post/v1/sessions
1curl https://api.openfort.xyz/v1/sessions \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x1234567890abcdef1234567890abcdef12345678' \
4  -d 'chainId=80001' \
5  -d 'validAfter=10' \
6  -d 'validUntil=12351235123' \
7  -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": {
      "userOpHash": "0x..."
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

List session keys of a 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.

  • player
    REQUIRED
    string

    The player ID (starts with pla_)

  • 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": {
          "userOpHash": "0x..."
        }
      },
      "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.

  • player
    REQUIRED
    string

    The player ID (starts with pla_).

post/v1/sessions/revoke
1curl https://api.openfort.xyz/v1/sessions/revoke \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'address=0x1234567890abcdef1234567890abcdef12345678' \
4  -d 'chainId=80001' \
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": {
      "userOpHash": "0x..."
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

Send signed userOpHash 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

post/v1/sessions/{id}/signature
1curl https://api.openfort.xyz/v1/sessions/ses_4194ad24-c818-4e5c-b003-9cc2aa7df53b/signature \
2  -u "$YOUR_PUBLIC_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": {
      "userOpHash": "0x..."
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

Returns a player session by session id

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": {
      "userOpHash": "0x..."
    }
  },
  "transactionIntents": [
    {
      "id": "tin_..."
    }
  ],
  "object": "session"
}

Add depositor address.

Verify signature and add a depositor address to the current project environment.

Body Parameters
  • depositorAddress
    REQUIRED
    string

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

  • signature
    REQUIRED
    string

    Signature to verify the account ownership.

post/v1/settings/depositor_addresses
1curl https://api.openfort.xyz/v1/settings/depositor_addresses \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'depositorAddress=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d' \
4  -d 'signature=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
{
  "id": "dep_00000000-0000-0000-0000-000000000000",
  "depositorAddress": "0x0000000000000000000000000000000000000000"
}

List of depositor addresses.

Retrieve the list of the depositor addresses for the current project environment.

get/v1/settings/depositor_addresses
1curl https://api.openfort.xyz/v1/settings/depositor_addresses \
2  -u "$YOUR_SECRET_KEY:"
{
  "url": "/v1/settings/depositor_addresses",
  "object": "list",
  "data": [
    {
      "id": "dep_00000000-0000-0000-0000-000000000000",
      "depositorAddress": "0x0000000000000000000000000000000000000000"
    },
    {
      "id": "dep_88888888-8888-8888-8888-888888888888",
      "depositorAddress": "0x8888888888888888888888888888888888888888"
    }
  ],
  "start": 0,
  "end": 2,
  "total": 2
}

Removes depositor address.

Remove a depositor address from the current project environment.

Path Parameters
  • id
    REQUIRED
    string

    Specifies unique identifier of depositor address.

delete/v1/settings/depositor_addresses/{id}
1curl https://api.openfort.xyz/v1/settings/depositor_addresses/dep_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "dep_00000000-0000-0000-0000-000000000000",
  "object": "paymasterDepositor",
  "deleted": true
}

Generate message to sign

Generate message, which should be signed for verification of the address ownership.

Query Parameters
  • address
    REQUIRED
    string

    Specifies the paymaster depositor address

get/v1/settings/depositor_addresses/message_to_sign
1curl https://api.openfort.xyz/v1/settings/depositor_addresses/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",
  "depositorAddress": "0x0000000000000000000000000000000000000000"
}

Update webhook.

Updated the current project environment settings by assigning the webhook address. This address is used to send events about the changes of the transaction intent state.

Body Parameters
  • url
    REQUIRED
    string

    The webhook url.

post/v1/settings/webhook
1curl https://api.openfort.xyz/v1/settings/webhook \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'url=https://example.com'

Removes webhook.

Updated the current project environment settings by removing the webhook address. After that system will stop sending events of the transaction intent state changes

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

List transaction intents.

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:

    nextAction

    policy

    player

    account

    Specifies the fields to expand in the response.

  • chainIdinteger

    The chain ID.

  • accountIdarray

    Filter by account ID.

  • playerIdarray

    Filter by player ID (starts with pla_).

  • policyIdarray

    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",
      "userOperationHash": "0x25d3...005c",
      "userOperation": {
        "sender": "0x63B7...484f",
        "nonce": 0,
        "initCode": "0x",
        "callData": "0x940d...0000",
        "callGasLimit": {
          "type": "BigNumber",
          "hex": "0x0352db"
        },
        "verificationGasLimit": {
          "type": "BigNumber",
          "hex": "0x0186a0"
        },
        "maxFeePerGas": {
          "type": "BigNumber",
          "hex": "0x9cca659e7c"
        },
        "maxPriorityFeePerGas": {
          "type": "BigNumber",
          "hex": "0x59682f00"
        },
        "paymasterAndData": "0x8076...931c",
        "signature": "0xbdf8...e81b",
        "preVerificationGas": {}
      },
      "chainId": 5,
      "updatedAt": 1689869074,
      "policy": {
        "id": "pol_..."
      },
      "player": {
        "id": "pla_..."
      },
      "account": {
        "id": "acc_..."
      },
      "response": {
        "createdAt": 1689869074,
        "logs": [],
        "blockNumber": 8789286,
        "userOpHash": "0x25d3...005c",
        "transactionHash": "0x25d3...005c",
        "to": "0x0576...1B57",
        "gasUsed": 336730,
        "status": 1,
        "error": null
      },
      "interactions": [
        {
          "functionName": "mint",
          "value": "100000000000000",
          "contract": "0x0576...1B57",
          "functionArgs": [
            "0x63B7...484f"
          ]
        }
      ]
    }
  ]
}

Create a transaction intent object.

Retrieve a transaction intent by providing their id on Openfort. Transaction intents that have not been processed yet, have the response attribute as undefined.

Body Parameters
  • player
    REQUIRED
    string

    The player ID (starts with pla_).

  • chainId
    REQUIRED
    integer

    The chain ID.

  • optimistic
    REQUIRED
    boolean

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

  • interactions
    REQUIRED
    array
post/v1/transaction_intents
1curl https://api.openfort.xyz/v1/transaction_intents \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60' \
4  -d 'chainId=80001' \
5  -d 'optimistic=true' \
6  -d 'interactions[0][contract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
7  -d 'interactions[0][functionName]=mint' \
8  -d 'interactions[0][functionArgs]=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Get a transaction intent object.

Path Parameters
  • id
    REQUIRED
    string

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

Query Parameters
  • expandarray

    An array with:

    nextAction

    policy

    player

    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",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

Estimate gas cost of creating a transaction

Estimate the gas cost of creating a transaction intent and putting it on chain. If a policy that includes payment of gas in ERC-20 tokens is provided, an extra field estimatedTXGasFeeToken is returned with the estimated amount of tokens.

Body Parameters
  • player
    REQUIRED
    string

    The player ID (starts with pla_).

  • chainId
    REQUIRED
    integer

    The chain ID.

  • optimistic
    REQUIRED
    boolean

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

  • interactions
    REQUIRED
    array
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 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60' \
4  -d 'chainId=80001' \
5  -d 'optimistic=true' \
6  -d 'interactions[0][contract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
7  -d 'interactions[0][functionName]=mint' \
8  -d 'interactions[0][functionArgs]=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
{
  "preVerificationGas": "55637",
  "verificationGas": "375974",
  "callGasLimit": "79646",
  "verificationGasLimit": "375974",
  "estimatedTXGas": "444793",
  "estimatedTXGasFee": "1162163748854053",
  "estimatedTXGasFeeUSD": "0.01",
  "gasPrice": "2612819331"
}

Send a signed transaction userOperationHash.

For non-custodial smart accounts, each on chain action using their wallet, they must sign the userOperationHash received from the POST API endpoint that creates a transactionIntent.

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

post/v1/transaction_intents/{id}/signature
1curl https://api.openfort.xyz/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65/signature \
2  -u "$YOUR_PUBLIC_KEY:" \
3  -d 'signature=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
{
  "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "createdAt": 1689869074,
  "object": "transactionIntent",
  "userOperationHash": "0x25d3...005c",
  "userOperation": {
    "sender": "0x63B7...484f",
    "nonce": 0,
    "initCode": "0x",
    "callData": "0x940d...0000",
    "callGasLimit": {
      "type": "BigNumber",
      "hex": "0x0352db"
    },
    "verificationGasLimit": {
      "type": "BigNumber",
      "hex": "0x0186a0"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x9cca659e7c"
    },
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x59682f00"
    },
    "paymasterAndData": "0x8076...931c",
    "signature": "0xbdf8...e81b",
    "preVerificationGas": {}
  },
  "chainId": 5,
  "updatedAt": 1689869074,
  "policy": {
    "id": "pol_..."
  },
  "player": {
    "id": "pla_..."
  },
  "account": {
    "id": "acc_..."
  },
  "response": {
    "createdAt": 1689869074,
    "logs": [],
    "blockNumber": 8789286,
    "userOpHash": "0x25d3...005c",
    "transactionHash": "0x25d3...005c",
    "to": "0x0576...1B57",
    "gasUsed": 336730,
    "status": 1,
    "error": null
  },
  "interactions": [
    {
      "functionName": "mint",
      "value": "100000000000000",
      "contract": "0x0576...1B57",
      "functionArgs": [
        "0x63B7...484f"
      ]
    }
  ]
}

List Web3 connections.

Returns a list of web3 connections for the given player. The connections are returned sorted by creation date, with the most recently created connections appearing first. By default, a maximum of ten connections 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.

  • playerstring

    Specifies the unique player ID (starts with pla_)

  • disconnectedboolean

    Specifies connection status

get/v1/web3_connections
1curl https://api.openfort.xyz/v1/web3_connections \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/web3_connections",
  "data": [
    {
      "id": "web3_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
      "object": "web3Connection",
      "createdAt": 1689869074,
      "player": "pla_...",
      "disconnected": false
    }
  ],
  "start": 0,
  "end": 1,
  "total": 1
}

Create a Web3 Connection object.

This endpoint allows you to create a new web3 connection to your Openfort player. Together with the player ID (pla_), you need to provide a chain ID. The chain to use is required because Openfort needs to make sure the account is deployed, as counterfactual addresses cannot use web3 connections. The uri body parameter must contain a WalletConnect pairing URI.

Body Parameters
  • player
    REQUIRED
    string

    The player ID (starts with pla_).

  • chainId
    REQUIRED
    integer

    The chain ID.

  • uri
    REQUIRED
    string

    Specifies the URI of WalletConnect.

post/v1/web3_connections
1curl https://api.openfort.xyz/v1/web3_connections \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60' \
4  -d 'chainId=80001' \
5  -d 'uri=wc:f6b98f7d78c5233413aacc7cbe9ff6035eec3611d36eb311051429a83af419a1@2?relay-protocol=irn&symKey=e8b33b4b969dc952ba6d28bd58f0ddb7ec1106a3c9610961218061a7813f11a6'
{
  "id": "web3_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "object": "web3Connection",
  "createdAt": 1689869074,
  "player": "pla_...",
  "disconnected": false
}

Get a web3Connection object.

Retrieves the details of an existing web3 connection. Supply the unique web3 connection ID from either a web3 connection creation request or the web3 connection list. Openfort will return the corresponding web3 connection information.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the unique web3Connection ID (starts with web3_).

Query Parameters
  • expandarray

    An array with:

    player

    Specifies the fields to expand.

get/v1/web3_connections/{id}
1curl https://api.openfort.xyz/v1/web3_connections/web3_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:"
{
  "id": "web3_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "object": "web3Connection",
  "createdAt": 1689869074,
  "player": "pla_...",
  "disconnected": false
}

List Web3 actions from a web3 connection.

Returns a list of web3 actions for the given web3 connection. The actions are returned sorted by creation date, with the most recently received action appearing first. By default, a maximum of ten actions are shown per page.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the web3Connection ID (starts with web3_).

get/v1/web3_connections/{id}/actions
1curl https://api.openfort.xyz/v1/web3_connections/web3_48eeba57-2cd5-4159-a2cb-057a23a35e65/actions \
2  -u "$YOUR_SECRET_KEY:"
{
  "object": "list",
  "url": "/v1/web3_actions",
  "data": [
    {
      "id": "act_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
      "object": "web3Action",
      "createdAt": 1689869074,
      "web3Connection": "web3_...",
      "status": "Pending",
      "method": "personal_sign",
      "chaindId": "11155111",
      "from": "0x...",
      "data": "0x...",
      "hashedData": "0x...",
      "decodedData": "This is a decoded data..."
    }
  ],
  "start": 0,
  "end": 1,
  "total": 1
}

Approve or Reject a web3 action

Approve or Reject a web3 action for the given web3 connection.

Path Parameters
  • id
    REQUIRED
    string

    Specifies the web3Connection ID (starts with web3_).

  • web3_action
    REQUIRED
    string

    Specifies web3_action (starts with act_).

Body Parameters
  • approve
    REQUIRED
    boolean

    True to approve the action, false to reject it.

post/v1/web3_connections/{id}/actions/{web3_action}
1curl https://api.openfort.xyz/v1/web3_connections/web3_48eeba57-2cd5-4159-a2cb-057a23a35e65/actions/act_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
2  -u "$YOUR_SECRET_KEY:" \
3  -d 'approve=true'
{
  "id": "act_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",
  "object": "web3Action",
  "createdAt": 1689869074,
  "web3Connection": "web3_...",
  "status": "Approved",
  "method": "personal_sign",
  "chaindId": "11155111",
  "from": "0x...",
  "data": "0x...",
  "hashedData": "0x...",
  "decodedData": "This is a decoded data..."
}