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.
_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.
_10 curl https://api.openfort.xyz/v1/players/pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60 \
_10 -u YOUR_SECRET_KEY: \
_10 -d "expand[]=accounts"
_35 "createdAt": 1689869074,
_35 "name": "Frank McCallister",
_35 "email": "Frank@dMcCallister.com",
_35 "description": "Tutorial",
_35 "createdAt": 1689869074,
_35 "address": "0x0B49...cc73",
_35 "id": "acc_7ccae011-4f30-41c0-876f-27679d3e81ef",
_35 "createdAt": 1689869074,
_35 "address": "0x0B49...cc73",
_35 "transactionIntents": [
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 Specifies the auth token.
curl https://api.openfort.xyz/iam/v1/verify \
-u " $YOUR_SECRET_KEY :" \
-d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9qZWN0SWQiOiJwcm9qZWN0XzQ4ZWViYTU3LTJjZDUtNDE1OS1hMmNiLTA1N2EyM2EzNWU2NSIsInVzZXJJZCI6InVzZXJfNDhlZWI1Ny0yY2Q1LTQxNTktYTJjYi0wNTdhMjNhMzVlNjUiLCJpYXQiOjE2MjY0NjY0NzcsImV4cCI6MTYyN'
Response Example 1 {
"projectId" : "pro_..." ,
"expiration" : 1234567890 ,
"issuedAt" : 1234567890 ,
"issuer" : "openfort.xyz" ,
"sessionId" : "..." ,
"playerId" : "pla_..." ,
"livemode" : true
}
List authenticated players. Retrieves a list of authenticated players.
Players have linked accounts and are authenticated with a provider.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
email string
Specifies the email address of the user.
curl https://api.openfort.xyz/iam/v1/players \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique player ID (starts with pla_).
delete /iam/v1/players/{id}
curl https://api.openfort.xyz/iam/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "pla_ff54b031-a878-4ca2-9cf5-ae190f921e9b" ,
"object" : "player" ,
"createdAt" : 1691658234 ,
"linkedAccounts" : [
{
"provider" : "email" ,
"email" : "jaume@openfort.xyz" ,
"disabled" : false ,
"updatedAt" : 1691658234
}
]
}
List of oauth configurations. List configured OAuth methods for the current project environment.
curl https://api.openfort.xyz/iam/v1/oauth \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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.
curl https://api.openfort.xyz/iam/v1/oauth \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 One of:
accelbyte
firebase
google
lootlocker
playfab
custom
oidc
supabase
Specifies the oauth provider type.
get /iam/v1/oauth/{provider}
curl https://api.openfort.xyz/iam/v1/oauth/{provider} \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 One of:
accelbyte
firebase
google
lootlocker
playfab
custom
oidc
supabase
Specifies the oauth provider type.
delete /iam/v1/oauth/{provider}
curl https://api.openfort.xyz/iam/v1/oauth/{provider} \
-u " $YOUR_SECRET_KEY :"
Retrieve player by oauth token. The endpoint verifies the token generated by OAuth provider and retrieves a corresponding player.
Body Parameters One of:
accelbyte
firebase
google
lootlocker
playfab
custom
oidc
supabase
One of:
idToken
customToken
curl https://api.openfort.xyz/iam/v1/oauth/verify \
-u " $YOUR_SECRET_KEY :" \
-d 'provider=firebase' \
-d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9' \
-d 'tokenType=idToken'
Response Example 1 {
"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.
Path Parameters One of:
accelbyte
firebase
google
lootlocker
playfab
custom
oidc
supabase
Body Parameters Access token to be verified
post /iam/v1/oauth/{provider}/verify
curl https://api.openfort.xyz/iam/v1/oauth/{provider}/verify \
-u " $YOUR_SECRET_KEY :" \
-d 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'
Response Example 1 {
"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.
By default, a maximum of 10 accounts are shown per page.
Query Parameters Specifies the unique player ID (starts with pla_)
limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
An array with:
transactionIntents
player
Specifies the fields to expand in the response.
curl https://api.openfort.xyz/v1/accounts \
-u " $YOUR_SECRET_KEY :" \
-d 'player=pla_6f6c9067-89fa-4fc8-ac72-c242a268c584'
Response Example 1 {
"object" : "list" ,
"url" : "/v1/accounts" ,
"start" : 0 ,
"end" : 1 ,
"total" : 1 ,
"data" : [
{
"id" : "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"deployed" : true ,
"custodial" : false ,
"embeddedSigner" : false ,
"object" : "account" ,
"accountType" : "Upgradeable_v05" ,
"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.
curl https://api.openfort.xyz/v1/accounts \
-u " $YOUR_SECRET_KEY :" \
-d 'chainId=80001'
Response Example 1 {
"id" : "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"deployed" : true ,
"custodial" : false ,
"embeddedSigner" : false ,
"object" : "account" ,
"accountType" : "Upgradeable_v05" ,
"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.
Path Parameters Specifies the unique account ID (starts with acc_).
Query Parameters expand array
An array with:
transactionIntents
player
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"deployed" : true ,
"custodial" : false ,
"embeddedSigner" : false ,
"object" : "account" ,
"accountType" : "Upgradeable_v05" ,
"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 Specifies the unique account ID (starts with acc_).
Body Parameters newOwnerAddress REQUIRED
string The address of the new owner
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
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/request_transfer_ownership \
-u " $YOUR_SECRET_KEY :" \
-d 'newOwnerAddress=0x1234567890abcdef1234567890abcdef12345678' \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"userOperation" : null ,
"chainId" : 80001 ,
"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" ,
"value" : "100000000000000" ,
"contract" : "0x0576...1B57" ,
"functionArgs" : [
"0x63B7...484f"
]
}
]
}
Cancel request to transfer ownership of an account. Cancel a pending transfer of ownership.
Path Parameters Specifies the unique account ID (starts with acc_).
Body Parameters 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
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/cancel_transfer_ownership \
-u " $YOUR_SECRET_KEY :" \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"userOperation" : null ,
"chainId" : 80001 ,
"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" ,
"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 Specifies the unique account ID (starts with acc_).
Body Parameters Domain. Specific to the dApp.
primaryType REQUIRED
string Hash to verify and that will be signed
post /v1/accounts/{id}/sign_payload
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/sign_payload \
-u " $YOUR_SECRET_KEY :" \
-d 'domain[0][chainId]=80001' \
-d 'primaryType=Mail' \
-d 'hash=0x3d8c6cab96bc24c87162c529bed5ba88b4617a7ea8bef66489a541d043ac6e8b'
Response Example 1 {
"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 Specifies the unique account ID (starts with acc_).
post /v1/accounts/{id}/sync
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/sync \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"deployed" : true ,
"custodial" : false ,
"embeddedSigner" : false ,
"object" : "account" ,
"accountType" : "Upgradeable_v05" ,
"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 Specifies the unique account ID (starts with acc_).
Body Parameters The policy ID (starts with pol_)
post /v1/accounts/{id}/deploy
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/deploy \
-u " $YOUR_SECRET_KEY :" \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
Response Example 1 {
"id" : "acc_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"deployed" : true ,
"custodial" : false ,
"embeddedSigner" : false ,
"object" : "account" ,
"accountType" : "Upgradeable_v05" ,
"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 Specifies the unique account ID (starts with acc_).
Body Parameters newOwnerAddress REQUIRED
string The policy ID (starts with pol_)
post /v1/accounts/{id}/start_recovery
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/start_recovery \
-u " $YOUR_SECRET_KEY :" \
-d 'newOwnerAddress=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d' \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"userOperation" : null ,
"chainId" : 80001 ,
"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" ,
"value" : "100000000000000" ,
"contract" : "0x0576...1B57" ,
"functionArgs" : [
"0x63B7...484f"
]
}
]
}
Complete a recovery process of a recoverable account.
Path Parameters Specifies the unique account ID (starts with acc_).
Body Parameters newOwnerAddress REQUIRED
string The policy ID (starts with pol_)
signatures array
Signatures by the guardians
post /v1/accounts/{id}/complete_recovery
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/complete_recovery \
-u " $YOUR_SECRET_KEY :" \
-d 'newOwnerAddress=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d' \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"userOperation" : null ,
"chainId" : 80001 ,
"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" ,
"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 limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
name string
Specifies the name of the contract.
deleted boolean
Specifies whether to include deleted contracts.
chainId integer
The chain ID of the contract.
address string
Specifies the address of the contract.
curl https://api.openfort.xyz/v1/contracts \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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" : 80001 ,
"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
curl https://api.openfort.xyz/v1/contracts \
-u " $YOUR_SECRET_KEY :" \
-d 'name=NFT Contract' \
-d 'chainId=80001' \
-d 'address=0x742e6e61d760164d56f44801054bcf40fa821d97'
Response Example 1 {
"id" : "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"object" : "contract" ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"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 Specifies the unique contract ID (starts with con_).
curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"object" : "contract" ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"deleted" : false ,
"name" : "MyContract" ,
"publicVerification" : true ,
"abi" : [
{
"constant" : false ,
"inputs" : [
{
"name" : "addr" ,
"type" : "address"
}
]
}
]
}
Updates a contract object.
Path Parameters Specifies the unique contract ID (starts with con_).
curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"object" : "contract" ,
"address" : "0x8C5cedA46A26214A52A9D7BF036Ad2F6255BdBEa" ,
"chainId" : 80001 ,
"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 Specifies the unique contract ID (starts with con_).
curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique contract ID (starts with con_).
Query Parameters functionName REQUIRED
string The function name of the contract.
functionArgs array
The function arguments of the contract, in string format. Accepts pla_, con_ and acc_ IDs.
get /v1/contracts/{id}/read
curl https://api.openfort.xyz/v1/contracts/con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35/ read \
-u " $YOUR_SECRET_KEY :" \
-d 'functionName=mint'
Response Example 1 {
"id" : "con_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"object" : "readContract" ,
"functionName" : "balanceOf" ,
"result" : {
"type" : "BigNumber" ,
"hex" : "0x00"
}
}
Get NFTs list of player. For development purposes only.
Under higher load scenarios, this endpoint may be rate limited.
Path Parameters Specifies the unique player ID (starts with pla_).
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
contract array
Filter by contract ID (starts with con_).
get /v1/players/{id}/inventory/nft
curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/inventory/nft \
-u " $YOUR_SECRET_KEY :" \
-d 'chainId=80001'
Response Example 1 {
"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 Specifies the unique player ID (starts with pla_).
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
contract array
Filter by contract ID (starts with con_).
get /v1/players/{id}/inventory/cryptocurrency
curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/inventory/cryptocurrency \
-u " $YOUR_SECRET_KEY :" \
-d 'chainId=80001'
Response Example 1 {
"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 Specifies the unique player ID (starts with pla_).
get /v1/players/{id}/inventory/native
curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/inventory/native \
-u " $YOUR_SECRET_KEY :" \
-d 'chainId=80001'
Response Example 1 {
"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 Specifies the unique account ID.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
contractId array
get /v1/accounts/{id}/inventory/nft
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/inventory/nft \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique account ID.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
contractId array
get /v1/accounts/{id}/inventory/cryptocurrency
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/inventory/cryptocurrency \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique account ID.
get /v1/accounts/{id}/inventory/native
curl https://api.openfort.xyz/v1/accounts/acc_4194ad24-c818-4e5c-b003-9cc2aa7df53b/inventory/native \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"object" : "inventory" ,
"url" : "/v1/accounts/acc_.../inventory/native" ,
"data" : {
"assetType" : "ETH" ,
"amount" : "1000000000000000000" ,
"lastTransferredAt" : 1689869074
}
}
List notifications. Returns a list of notifications.
Notifications are useful to get notified about events that happen on-chain or in your Openfort account.
Notifications are returned sorted by creation date, with the most recently created notifications appearing first.
By default, a maximum of 10 notifications are shown per page.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
An array with:
subscriptions
triggers
Specifies the fields to expand in the response.
deleted boolean
Specifies whether to include deleted notifications.
name string
Specifies the name of the notifications.
curl https://api.openfort.xyz/v1/notifications \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"object" : "list" ,
"url" : "/v1/notifications" ,
"start" : 0 ,
"end" : 1 ,
"total" : 1 ,
"data" : [
{
"id" : "not_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"updatedAt" : 1689869074 ,
"name" : "Low balance" ,
"deleted" : false ,
"object" : "notification" ,
"triggers" : [],
"subscriptions" : []
}
]
}
Create a notification object. Create a notification object.
Body Parameters The name of the notification.
curl https://api.openfort.xyz/v1/notifications \
-u " $YOUR_SECRET_KEY :" \
-d 'name=Low balance'
Response Example 1 {
"id" : "not_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"updatedAt" : 1689869074 ,
"name" : "Low balance" ,
"deleted" : false ,
"object" : "notification" ,
"triggers" : [],
"subscriptions" : []
}
Get existing notification. Retrieves the details of an existing notification.
Supply the unique notification ID.
Path Parameters Specifies the unique notification ID (starts with not_).
Query Parameters expand array
An array with:
subscriptions
triggers
get /v1/notifications/{id}
curl https://api.openfort.xyz/v1/notifications/not_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "not_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"updatedAt" : 1689869074 ,
"name" : "Low balance" ,
"deleted" : false ,
"object" : "notification" ,
"triggers" : [],
"subscriptions" : []
}
Deletes a notification object. Delete a notification by providing its notification id.
Path Parameters Specifies the unique notification ID (starts with not_).
delete /v1/notifications/{id}
curl https://api.openfort.xyz/v1/notifications/not_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "not_00000000-0000-0000-0000-000000000000" ,
"object" : "notification" ,
"deleted" : true
}
List notification subscriptions of a notification. Returns a list of subscriptions of a notification.
Subscriptions define the the way you will get notified and the target of the notification.
Subscriptions are returned sorted by creation date, with the most recently created accounts appearing first.
By default, a maximum of 10 notification subscriptions are shown per page.
Query Parameters notification REQUIRED
string Specifies the unique notification ID (starts with not_).
limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
get /v1/notification_subscriptions
curl https://api.openfort.xyz/v1/notification_subscriptions \
-u " $YOUR_SECRET_KEY :" \
-d 'notification=not_48eeba57-2cd5-4159-a2cb-057a23a35e65'
Response Example 1 {
"object" : "list" ,
"url" : "/v1/notification_subscriptions" ,
"start" : 0 ,
"end" : 1 ,
"total" : 1 ,
"data" : [
{
"id" : "nsu_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"target" : "jaume@openfort.xyz" ,
"method" : "Email" ,
"object" : "notificationSubscription"
}
]
}
Create a notification subscription object. Create a subscription for the provided notification.
Body Parameters notification REQUIRED
string The notification ID (starts with not_).
The type of notification.
The receiver of notifications.
post /v1/notification_subscriptions
curl https://api.openfort.xyz/v1/notification_subscriptions \
-u " $YOUR_SECRET_KEY :" \
-d 'notification=not_e0b84653-1741-4a3d-9e91-2b0fd2942f60' \
-d 'method=Email' \
-d 'target=jaume@openfort.xyz'
Response Example 1 {
"id" : "nsu_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"target" : "jaume@openfort.xyz" ,
"method" : "Email" ,
"object" : "notificationSubscription"
}
Get existing notification subscription. Retrieves the details of an existing notification subscription.
Supply the unique notification subscription ID.
Path Parameters Specifies the unique notification subscription ID (starts with not_).
get /v1/notification_subscriptions/{id}
curl https://api.openfort.xyz/v1/notification_subscriptions/nsu_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "nsu_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"createdAt" : 1689869074 ,
"target" : "jaume@openfort.xyz" ,
"method" : "Email" ,
"object" : "notificationSubscription"
}
Deletes a notification subscription object. Delete a notification subscription by providing its notification subscription id.
Path Parameters Specifies the unique notification subscription ID (starts with ntr_).
delete /v1/notification_subscriptions/{id}
curl https://api.openfort.xyz/v1/notification_subscriptions/nsu_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "nsu_00000000-0000-0000-0000-000000000000" ,
"object" : "notificationSubscription" ,
"deleted" : true
}
List notification triggers of a notification. Returns a list of triggers of a notification.
Triggers define the conditions that will trigger a notification.
Triggers are returned sorted by creation date, with the most recently created accounts appearing first.
By default, a maximum of 10 notification triggers are shown per page.
Query Parameters notification REQUIRED
string Specifies the unique notification ID (starts with not_).
limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
get /v1/notification_triggers
curl https://api.openfort.xyz/v1/notification_triggers \
-u " $YOUR_SECRET_KEY :" \
-d 'notification=not_48eeba57-2cd5-4159-a2cb-057a23a35e65'
Response Example 1 {
"object" : "list" ,
"url" : "/v1/notification_triggers" ,
"start" : 0 ,
"end" : 1 ,
"total" : 1 ,
"data" : [
{
"id" : "not_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"threshold" : "1000000000000000000" ,
"createdAt" : 1689869074 ,
"account" : {
"id" : "dac_00000000-0000-0000-0000-000000000000"
},
"chainId" : 80001 ,
"object" : "notificationTrigger" ,
"type" : "developer_account_trigger"
}
]
}
Create a notification trigger object. Create a trigger for the provided notification.
Body Parameters notification REQUIRED
string The notification ID (starts with not_).
One of:
contract_trigger
developer_account_trigger
project_balance_trigger
The type of trigger notification to add.
The threshold value at which (greater or equal) the notification will be triggered.
functionName string
The function name of the contract. Accepts a a function signature as well (e.g. mint(address)).
functionArgs array
The function arguments of the contract, in string format. If you provide one of a pla_...
, con_...
or acc_...
it will be converted to the corresponding address.
contract string
The contract ID you want to interact with. Must have been added to Openfort first, starts with con_
.
chainId integer
The chain ID. Must be a supported chain .
account string
ID of the Developer Account this trigger will check the balance of (starts with dac_
).
post /v1/notification_triggers
curl https://api.openfort.xyz/v1/notification_triggers \
-u " $YOUR_SECRET_KEY :" \
-d 'notification=not_e0b84653-1741-4a3d-9e91-2b0fd2942f60' \
-d 'type=project_balance_trigger' \
-d 'threshold=1000000000'
Response Example 1 {
"id" : "not_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"threshold" : "1000000000000000000" ,
"createdAt" : 1689869074 ,
"account" : {
"id" : "dac_00000000-0000-0000-0000-000000000000"
},
"chainId" : 80001 ,
"object" : "notificationTrigger" ,
"type" : "developer_account_trigger"
}
Get existing notification trigger. Retrieves the details of an existing notification trigger.
Supply the unique notification trigger ID.
Path Parameters Specifies the unique notification trigger ID (starts with ntr_).
get /v1/notification_triggers/{id}
curl https://api.openfort.xyz/v1/notification_triggers/ntr_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "not_c502d628-5bb3-42f2-b8d5-62ba46717f3a" ,
"threshold" : "1000000000000000000" ,
"createdAt" : 1689869074 ,
"account" : {
"id" : "dac_00000000-0000-0000-0000-000000000000"
},
"chainId" : 80001 ,
"object" : "notificationTrigger" ,
"type" : "developer_account_trigger"
}
Deletes a notification trigger object. Delete a notification trigger by providing its notification trigger id.
Path Parameters Specifies the unique notification trigger ID (starts with ntr_).
delete /v1/notification_triggers/{id}
curl https://api.openfort.xyz/v1/notification_triggers/ntr_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "ntr_00000000-0000-0000-0000-000000000000" ,
"object" : "notificationTrigger" ,
"deleted" : true
}
List players. By default, a maximum of ten players are shown.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
An array with:
transactionIntents
accounts
Specifies the fields to expand in the response.
name string
curl https://api.openfort.xyz/v1/players \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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. Body Parameters name string
Specifies the player name.
description string
Specifies the player description.
metadata object
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.
curl https://api.openfort.xyz/v1/players \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique player ID (starts with pla_).
Query Parameters expand array
An array with:
transactionIntents
accounts
Specifies the expandable fields.
curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique player ID (starts with pla_).
Body Parameters name string
Specifies the player name.
description string
Specifies the player description.
metadata object
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.
curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique player ID (starts with pla_).
curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique player ID (starts with pla_).
Body Parameters ID of the Policy that defines the gas sponsorship strategy (starts with pol_
). A policy must be provided.
The chain ID. Must be a supported chain .
newOwnerAddress REQUIRED
string The address of the new owner
player string
ID of the Player that has the Account you want to transfer ownership from (starts with pla_
).
post /v1/players/{id}/request_transfer_ownership
curl https://api.openfort.xyz/v1/players/pla_48eeba57-2cd5-4159-a2cb-057a23a35e65/request_transfer_ownership \
-u " $YOUR_SECRET_KEY :" \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd' \
-d 'chainId=80001' \
-d 'newOwnerAddress=0x1234567890abcdef1234567890abcdef12345678'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"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" : 80001 ,
"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" ,
"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.
Body Parameters ID of the Policy that defines the gas sponsorship strategy (starts with pol_
). A policy must be provided.
The chain ID. Must be a supported chain .
post /v1/players/{id}/cancel_transfer_ownership
curl https://api.openfort.xyz/v1/players/{id}/cancel_transfer_ownership \
-u " $YOUR_SECRET_KEY :" \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd' \
-d 'chainId=80001'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"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" : 80001 ,
"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" ,
"value" : "100000000000000" ,
"contract" : "0x0576...1B57" ,
"functionArgs" : [
"0x63B7...484f"
]
}
]
}
List policies. Returns a list of Policies.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
An array with:
transactionIntents
policyRules
Specifies the fields to expand in the response.
name string
Specifies the name of the policy.
deleted boolean
Specifies whether to include deleted policies.
chainId integer
The chain ID of the policy.
enabled boolean
Specifies whether to include enabled policies.
curl https://api.openfort.xyz/v1/policies \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"object" : "list" ,
"url" : "/v1/policies" ,
"start" : 0 ,
"end" : 1 ,
"total" : 1 ,
"data" : [
{
"id" : "pol_..." ,
"createdAt" : 1689869074 ,
"name" : "TEST" ,
"chainId" : 80001 ,
"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 Specifies the name of the policy.
The chain ID. Must be a supported chain .
The sponsor schema of the policy.
Open accepted values sponsorSchema string
The sponsor schema of the policy.
One of:
pay_for_user
charge_custom_tokens
fixed_rate
tokenContract string
If the user pays in custom tokens, the contract ID (starts with con_) of the token contract.
tokenContractAmount string
If the user pays in ERC20 tokens, this reflects either the exchange rate or the amount in WEI.
depositor string
If the you want to use your own native tokens to pay for gas, specify the developer account ID (starts with dac_)
curl https://api.openfort.xyz/v1/policies \
-u " $YOUR_SECRET_KEY :" \
-d 'name=My Policy' \
-d 'chainId=80001' \
-d 'strategy[0][sponsorSchema]=fixed_rate' \
-d 'strategy[0][tokenContract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
-d 'strategy[0][tokenContractAmount]=1000000000000000000' \
Response Example 1 {
"id" : "pol_..." ,
"createdAt" : 1689869074 ,
"name" : "TEST" ,
"chainId" : 80001 ,
"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.
Path Parameters Specifies the unique policy ID (starts with pol_).
Query Parameters expand array
An array with:
transactionIntents
policyRules
Specifies the fields to expand.
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "pol_..." ,
"createdAt" : 1689869074 ,
"name" : "TEST" ,
"chainId" : 80001 ,
"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 Specifies the unique policy ID (starts with pol_).
Body Parameters name string
Specifies the name of the policy.
chainId integer
The chain ID. Must be a supported chain .
strategy object
The sponsor schema of the policy.
Open accepted values sponsorSchema string
The sponsor schema of the policy.
One of:
pay_for_user
charge_custom_tokens
fixed_rate
tokenContract string
If the user pays in custom tokens, the contract ID (starts with con_) of the token contract.
tokenContractAmount string
If the user pays in ERC20 tokens, this reflects either the exchange rate or the amount in WEI.
depositor string
If the you want to use your own native tokens to pay for gas, specify the developer account ID (starts with dac_)
deleted boolean
Specifies whether to delete the policy.
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "pol_..." ,
"createdAt" : 1689869074 ,
"name" : "TEST" ,
"chainId" : 80001 ,
"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 Specifies the unique policy ID (starts with pol_).
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "pol_..." ,
"deleted" : true ,
"object" : "policy"
}
Disable a policy object.
Path Parameters Specifies the unique policy ID (starts with pol_).
put /v1/policies/{id}/disable
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/ disable \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "pol_..." ,
"createdAt" : 1689869074 ,
"name" : "TEST" ,
"chainId" : 80001 ,
"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 Specifies the unique policy ID (starts with pol_).
put /v1/policies/{id}/enable
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/ enable \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "pol_..." ,
"createdAt" : 1689869074 ,
"name" : "TEST" ,
"chainId" : 80001 ,
"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 Specifies the unique policy ID (starts with pol_).
get /v1/policies/{id}/reports
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/reports \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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"
}
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 Specifies the unique policy ID (starts with pol_).
get /v1/policies/{id}/withdraw
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/withdraw \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the unique policy ID (starts with pol_).
Body Parameters ID of the Dev Account this TransactionIntent will send the specified amount of tokens to (starts with dac_
).
Amount in WEI to withdraw (i.e. factor 10^18)..
post /v1/policies/{id}/withdraw
curl https://api.openfort.xyz/v1/policies/pol_48eeba57-2cd5-4159-a2cb-057a23a35e65/withdraw \
-u " $YOUR_SECRET_KEY :" \
-d 'account=dac_e1b24353-1741-4a3d-9e91-2b0fd2942f60' \
-d 'amount=300000'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"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" : 80001 ,
"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" ,
"value" : "100000000000000" ,
"contract" : "0x0576...1B57" ,
"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 Specifies the unique policy ID (starts with pol_).
limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
Specifies the fields to expand in the response.
curl https://api.openfort.xyz/v1/policy_rules \
-u " $YOUR_SECRET_KEY :" \
-d 'policy=pol_48eeba57-2cd5-4159-a2cb-057a23a35e65'
Response Example 1 {
"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 One of:
contract_functions
account_functions
rate_limit
The unique Policy ID to add the rule to (starts with pol_).
functionName string
Name of the function in the contract to allow. If you want to allow all functions, use the wildcard 'All functions'.
contract string
The contract ID you want to interact with. Must have been added to Openfort first, starts with con_
.
gasLimit string
Gas limit in WEI (i.e. factor 10^18).
countLimit integer
Number of times the function will be sponsored.
timeIntervalType string
One of:
minute
hour
day
week
month
Time interval between sponsorships.
timeIntervalValue integer
curl https://api.openfort.xyz/v1/policy_rules \
-u " $YOUR_SECRET_KEY :" \
-d 'type=account_functions' \
-d 'policy=pol_7e07ae30-2a4d-48fa-803f-361da94905dd'
Response Limit contract sponsorship {
"createdAt" : 1689869074 ,
"id" : "afu_..." ,
"object" : "policyRule" ,
"type" : "contract_functions" ,
"contract" : {
"id" : "con_..."
},
"functionName" : "mint"
}
Response Limit number of sponsored txns
Response Limit gas sponsored in interval
Response Limit gas spent per txn
Response Allow self account sponsorship
Update a policy rule object.
Path Parameters Specifies the unique policy rule ID (starts with afu_).
Body Parameters One of:
contract_functions
account_functions
rate_limit
functionName string
Name of the function in the contract to allow. If you want to allow all functions, use the wildcard 'All functions'.
contract string
The contract ID you want to interact with. Must have been added to Openfort first, starts with con_
.
gasLimit string
Gas limit in WEI (i.e. factor 10^18).
countLimit integer
Number of times the function will be sponsored.
timeIntervalType string
One of:
minute
hour
day
week
month
Time interval between sponsorships.
timeIntervalValue integer
post /v1/policy_rules/{id}
curl https://api.openfort.xyz/v1/policy_rules/afu_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :" \
-d 'type=account_functions'
Response Example 1 {
"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 Specifies the unique policy rule ID (starts with afu_).
delete /v1/policy_rules/{id}
curl https://api.openfort.xyz/v1/policy_rules/afu_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "afu_..." ,
"object" : "policyRule" ,
"deleted" : true
}
List session keys of a player. Returns a list of Sessions.
Query Parameters The player ID (starts with pla_)
limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
An array with:
transactionIntents
Specifies the fields to expand in the response.
curl https://api.openfort.xyz/v1/sessions \
-u " $YOUR_SECRET_KEY :" \
-d 'player=pla_48eeba57-2cd5-4159-a2cb-057a23a35e65'
Response Example 1 {
"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. curl https://api.openfort.xyz/v1/sessions \
-u " $YOUR_SECRET_KEY :" \
-d 'address=0x1234567890abcdef1234567890abcdef12345678' \
-d 'chainId=80001' \
-d 'validAfter=10' \
-d 'validUntil=123512123' \
-d 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60'
Response Example 1 {
"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 The address of the session key to revoke.
The chain ID. Must be a supported chain .
The player ID (starts with pla_).
policy string
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.
optimistic boolean
Whether the transactionIntent is optimistic (resolve before it arrives on chain) or not.
curl https://api.openfort.xyz/v1/sessions/revoke \
-u " $YOUR_SECRET_KEY :" \
-d 'address=0x1234567890abcdef1234567890abcdef12345678' \
-d 'chainId=80001' \
-d 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60'
Response Example 1 {
"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 Specifies the unique session ID (starts with ses_).
Body Parameters signed userOperationHash by the owner or valid session key
optimistic boolean
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
curl https://api.openfort.xyz/v1/sessions/ses_4194ad24-c818-4e5c-b003-9cc2aa7df53b/signature \
-u " $YOUR_SECRET_KEY :" \
-d 'signature=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
Response Example 1 {
"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.
Path Parameters Specifies the unique session ID (starts with ses_).
Query Parameters expand array
An array with:
transactionIntents
Specifies the fields to expand.
curl https://api.openfort.xyz/v1/sessions/ses_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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.
By default, a maximum of 10 accounts are shown per page.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
An array with:
transactionIntents
Specifies the fields to expand in the response.
deleted boolean
Specifies whether to include deleted dev accounts.
get /v1/settings/developer_accounts
curl https://api.openfort.xyz/v1/settings/developer_accounts \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 address string
The address of the wallet that has deposited funds in the paymaster.
signature string
Signature to verify the account ownership.
name string
post /v1/settings/developer_accounts
curl https://api.openfort.xyz/v1/settings/developer_accounts \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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"
}
]
}
Generate message to sign Generate message, which should be signed by the account your want to add as a developer account.
get /v1/settings/developer_accounts/message_to_sign
curl https://api.openfort.xyz/v1/settings/developer_accounts/message_to_sign \
-u " $YOUR_SECRET_KEY :" \
-d 'address=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
Response Example 1 {
"message" : "I want to register 0x0000000000000000000000000000000000000000 to the project 33333333-3333-3333-3333-333333333333 for mainnets on 20231231" ,
"address" : "0x0000000000000000000000000000000000000000"
}
Get existing developer account. Retrieve a developer account.
Path Parameters Specifies the unique developer account ID (starts with dac_).
Query Parameters expand array
An array with:
transactionIntents
get /v1/settings/developer_accounts/{id}
curl https://api.openfort.xyz/v1/settings/developer_accounts/dac_4194ad24-c818-4e5c-b003-9cc2aa7df53b \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies a unique developer account (starts with dac_).
delete /v1/settings/developer_accounts/{id}
curl https://api.openfort.xyz/v1/settings/developer_accounts/dac_0cddb398-1dc6-4e6f-8726-9ec7cea85f35 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "dac_00000000-0000-0000-0000-000000000000" ,
"object" : "developerAccount" ,
"deleted" : true
}
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.
curl https://api.openfort.xyz/v1/settings/webhook \
-u " $YOUR_SECRET_KEY :" \
-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
curl https://api.openfort.xyz/v1/settings/webhook \
-u " $YOUR_SECRET_KEY :"
List transaction intents. Returns a list of TransactionIntents.
Query Parameters limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
expand array
An array with:
player
policy
account
Specifies the fields to expand in the response.
chainId integer
The chain ID. Must be a supported chain .
account array
Filter by account ID or developer account (starts with acc_ or dac_ respectively).
player array
Filter by player ID (starts with pla_).
status number
Filter by successful (1) or failed (0) transaction intents.
policy array
Filter by policy ID (starts with pol_).
get /v1/transaction_intents
curl https://api.openfort.xyz/v1/transaction_intents \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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" : "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" : 80001 ,
"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" ,
"value" : "100000000000000" ,
"contract" : "0x0576...1B57" ,
"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.
post /v1/transaction_intents
curl https://api.openfort.xyz/v1/transaction_intents \
-u " $YOUR_SECRET_KEY :" \
-d 'chainId=80001' \
-d 'interactions[0][contract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
-d 'interactions[0][functionName]=mint' \
-d 'interactions[0][functionArgs][0]=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
Response Transaction for custodial account {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"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" : 80001 ,
"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" ,
"value" : "100000000000000" ,
"contract" : "0x0576...1B57" ,
"functionArgs" : [
"0x63B7...484f"
]
}
]
}
Response Transaction for non-custodial account
Response Optimistic Transaction for custodial account
Get a transaction intent object. Retrieves the details of a TransactionIntent that has previously been created.
Path Parameters Specifies the unique transaction intent ID (starts with tin_).
Query Parameters expand array
An array with:
player
policy
account
Specifies the expandable fields.
get /v1/transaction_intents/{id}
curl https://api.openfort.xyz/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"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" : 80001 ,
"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" ,
"value" : "100000000000000" ,
"contract" : "0x0576...1B57" ,
"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.
post /v1/transaction_intents/estimate_gas_cost
curl https://api.openfort.xyz/v1/transaction_intents/estimate_gas_cost \
-u " $YOUR_SECRET_KEY :" \
-d 'chainId=80001' \
-d 'interactions[0][contract]=con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35' \
-d 'interactions[0][functionName]=mint' \
-d 'interactions[0][functionArgs][0]=0x662D24Bf7Ea2dD6a7D0935F680a6056b94fE934d'
Response Gas estimation {
"preVerificationGas" : "55637" ,
"verificationGas" : "375974" ,
"callGasLimit" : "79646" ,
"verificationGasLimit" : "375974" ,
"estimatedTXGas" : "444793" ,
"estimatedTXGasFee" : "1162163748854053" ,
"estimatedTXGasFeeUSD" : "0.01" ,
"gasPrice" : "2612819331"
}
Response Gas estimation with token policy
Send a signed transaction userOperationHash. Broadcasts a signed TransactionIntent to the blockchain.
Use this endpoint to send the signed userOperationHash
. Openfort will then put it on-chain.
Path Parameters Specifies the unique transaction intent ID (starts with tin_).
Body Parameters signed userOperationHash by the owner or valid session key
optimistic boolean
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
curl https://api.openfort.xyz/v1/transaction_intents/tin_48eeba57-2cd5-4159-a2cb-057a23a35e65/signature \
-u " $YOUR_SECRET_KEY :" \
-d 'signature=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
Response Example 1 {
"id" : "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a" ,
"createdAt" : 1689869074 ,
"object" : "transactionIntent" ,
"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" : 80001 ,
"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" ,
"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 limit integer
Specifies the maximum number of records to return.
skip integer
Specifies the offset for the first records to return.
order string
Specifies the order in which to sort the results.
player string
Specifies the unique player ID (starts with pla_)
disconnected boolean
Specifies connection status
curl https://api.openfort.xyz/v1/web3_connections \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 ID of the Player this Web3Connection belongs to (starts with pla_
).
The chain ID. Must be a supported chain .
Specifies the URI of WalletConnect.
curl https://api.openfort.xyz/v1/web3_connections \
-u " $YOUR_SECRET_KEY :" \
-d 'player=pla_e0b84653-1741-4a3d-9e91-2b0fd2942f60' \
-d 'chainId=80001' \
-d 'uri=wc:f6b98f7d78c5233413aacc7cbe9ff6035eec3611d36eb311051429a83af419a1@2?relay-protocol=irn&symKey=e8b33b4b969dc952ba6d28bd58f0ddb7ec1106a3c9610961218061a7813f11a6'
Response Example 1 {
"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 Specifies the unique web3Connection ID (starts with web3_).
Query Parameters expand array
Specifies the fields to expand.
get /v1/web3_connections/{id}
curl https://api.openfort.xyz/v1/web3_connections/web3_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the web3Connection ID (starts with web3_).
get /v1/web3_connections/{id}/actions
curl https://api.openfort.xyz/v1/web3_connections/web3_48eeba57-2cd5-4159-a2cb-057a23a35e65/actions \
-u " $YOUR_SECRET_KEY :"
Response Example 1 {
"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 Specifies the web3Connection ID (starts with web3_).
web3_action REQUIRED
string Specifies web3_action (starts with act_).
Body Parameters True to approve the action, false to reject it.
policy string
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.
signature string
post /v1/web3_connections/{id}/actions/{web3_action}
curl https://api.openfort.xyz/v1/web3_connections/web3_48eeba57-2cd5-4159-a2cb-057a23a35e65/actions/act_48eeba57-2cd5-4159-a2cb-057a23a35e65 \
-u " $YOUR_SECRET_KEY :" \
-d 'approve=true'
Response Example 1 {
"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..."
}