Fordefi API (0.2.0)

Download OpenAPI description
Languages
Servers
Production
https://api.fordefi.com/

Users

This resource collection represents users.

User types and roles

There are several types of user in the Fordefi platform:
  • Person: A human user of the platform. Only a person can have an admin role.
  • API User: An API client key that is trying to interact with the platform.See Create an API user and token.
  • API Signer: Used to auto-sign transactions. See Automate Signing with API Signer.
  • End user: For Consumer Wallets. It represents the user of a third-party platform.
In addition, for all users (except end users in WaaS solutions) there are three possible user roles, which define the permissions that the user is given:
  • Admin: A user with high privileges in the organization. Only admins have permission to manage the policy, set up the backup, manage the address book, and add or remove users in the organization. Only a person can have an admin role.
  • Trader: A user who can create vaults and transactions.
  • Viewer: A user who has full view of the organization's users, addresses, and policies, as well as of the vaults and transactions, but does not have permissions to create them.

Operations

Authorization Tokens

This resource collection represents authorization tokens.

These tokens allow end users to authenticate with Fordefi. Each end user can have a maximum of ten active authorization tokens at any time. Each token is valid for 24 hours only.

Instructions for creating an API user and token are provided here: Create an API user and token.

Operations

Blockchains

This resource collection represents blockchains.

Operations

Webhooks

This resource collection represents webhooks.

Use Webhooks describes how to configure webhooks, validate them, and resend them.

Operations

Address Book

This resource collection represents an address book.

Address Book is an object that represents a contact (saved blockchain address and its alias) in the platform. The Address Book object can either be queried directly or returned as part of a transaction.

Operations

Transactions

This resource collection represents a transaction.

A transaction is any object that can be signed cryptographically (with a private key).

In general, it can be one of the following types:

  • EVM Transaction: A native currency transfer or a smart contract call on an EVM-based chain.
  • EVM Message: In which a message is signed for off-chain use on an EVM-based chain.
  • Solana Transaction: A list of instructions to invoke on a Solana-based chain.
  • Cosmos Transaction: A transaction in the Cosmos ecosystem on Cosmos Hub or one of the supported app chains.
  • Black Box Signature: In which a payload is signed for use, external to the Fordefi platform.
  • Cosmos Message
  • Solana Message
For more information, see Transaction Types.

Monitor transactions

As transactions progress from creation through completion, they can follow several workflows, during which they take on various statuses. Status is returned in the state field of the Get Transaction and List Transaction requests.

For a list of possible statuses, see Transaction Lifecycle.

Operations

Batch Transactions

This resource collection represents a batch transaction.

Operations

Create Batch Transaction

Request

Create a batch of transactions.
Batch transactions are currently supported only on Solana, for the purpose of supporting the signAllTranactions flow used by certain Solana DApps. Batch transactions undergo policy evaluation as a whole: the policy is applied to a “virtual transaction” whose list of instructions is the union of the instructions of the individual transactions in the batch, and whose balance changes are the aggregation of balance changes of the individual transactions.
Batch transactions are always signed jointly, and sent to the blockchain according to their order in the batch.

Headers
x-signaturestring

Signature of the body. Base64 encoded string. If the request is made programatically by an API user, signing of the request is required and is intended to protect you from malicious backends.

Example: SGVsbG8=
x-timestampinteger

Timestamp of the signature. Integer. Specify an Epoch date. If the request is made programatically by an API user, the timestamp of the request is required and is intended to protect you from replay attacks.

x-idempotence-idstring(uuid)

Optional idempotence ID of a transaction.

Bodyapplication/jsonrequired
vault_idstring(uuid)required

The unique identifier of the vault.

notestring

An optional transaction note.

signer_typestring

The signer of the transaction. Can be:

  • initiator: The creator of the transaction (default).
  • api_signer: A service that you run on your own network or cloud environment.
  • end_user: A mobile device using Fordefi's SDK.

Default "initiator"
Enum"initiator""api_signer""end_user""multiple_signers"
sign_modestring

The sign mode of the transaction determines when the transaction will transition to the signing phase. It can be one of the following:

  • auto: The transaction will move to signing automatically after approval.
  • triggered: The transaction will be in the waiting_for_signing_trigger state until "Trigger Transaction Signing" is called. Currently supported only for API Signer signer type.

Default "auto"
Enum"auto""triggered"
typestringrequired

Solana transaction type.

Discriminator
Value "solana_transaction"
detailsobjectrequired
curl -i -X POST \
  https://api.fordefi.com/api/v1/batch-transactions \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'x-idempotence-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -H 'x-signature: SGVsbG8=' \
  -H 'x-timestamp: 0' \
  -d '{
    "vault_id": "432b199b-1f71-42bf-ba0b-33d512afa9de",
    "note": "string",
    "signer_type": "initiator",
    "sign_mode": "auto",
    "type": "solana_transaction",
    "details": {
      "type": "solana_raw_transaction",
      "fail_on_prediction_failure": true,
      "push_mode": "auto",
      "skip_prediction": false,
      "chain": "solana_mainnet",
      "transactions": [
        {
          "version": "legacy",
          "instructions": [
            {
              "program_index": 0,
              "data": "SGVsbG8=",
              "account_indexes": [
                0
              ]
            }
          ],
          "accounts": [
            {
              "address": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA",
              "writable": true,
              "signer": true,
              "ephemeral_key": "lnNyP8kFPEaVpvUo/SIlhdZlzhPU8r7yT/h0gG5ajzQ="
            }
          ],
          "address_table_lookups": [
            {
              "account_key": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA",
              "writable_indexes": [
                0
              ],
              "readonly_indexes": [
                0
              ]
            }
          ],
          "signatures": [
            {
              "data": "SGVsbG8="
            }
          ],
          "recent_blockhash": "4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZAMdL4VZHirAn"
        }
      ]
    }
  }'

Responses

Successful Response

Bodyapplication/json
batch_idstring(uuid)required

ID of the batch of transactions.

transactionsArray of anyrequired
Response
application/json
{ "batch_id": "4da22c97-b7d5-4e31-8c3a-03870ebc7b20", "transactions": [ {} ] }

Predict Batch Transaction

Request

Simulate the batch of transactions and show changes in token balances, in addition to the fee estimation.
Batch transactions are currently supported only on Solana, for the purpose of supporting the signAllTransactions flow used by certain Solana DApps. Batch transactions undergo policy evaluation as a whole: the policy is applied to a “virtual transaction” whose list of instructions is the union of the instructions of the individual transactions in the batch, and whose balance changes are the aggregation of balance changes of the individual transactions.

Bodyapplication/jsonrequired
vault_idstring(uuid)required

The unique identifier of the vault.

notestring

An optional transaction note.

typestringrequired

The type of the transaction.

Discriminator
Value "solana_transaction"
detailsanyrequired
curl -i -X POST \
  https://api.fordefi.com/api/v1/batch-transactions/predict \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "vault_id": "432b199b-1f71-42bf-ba0b-33d512afa9de",
    "note": "string",
    "type": "solana_transaction",
    "details": {
      "type": "solana_raw_transaction",
      "fail_on_prediction_failure": true,
      "skip_simulation": false,
      "chain": "solana_mainnet",
      "transactions": [
        {
          "version": "legacy",
          "instructions": [
            {
              "program_index": 0,
              "data": "SGVsbG8=",
              "account_indexes": [
                0
              ]
            }
          ],
          "accounts": [
            {
              "address": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA",
              "writable": true,
              "signer": true,
              "ephemeral_key": "lnNyP8kFPEaVpvUo/SIlhdZlzhPU8r7yT/h0gG5ajzQ="
            }
          ],
          "address_table_lookups": [
            {
              "account_key": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA",
              "writable_indexes": [
                0
              ],
              "readonly_indexes": [
                0
              ]
            }
          ],
          "signatures": [
            {
              "data": "SGVsbG8="
            }
          ],
          "recent_blockhash": "4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZAMdL4VZHirAn"
        }
      ]
    }
  }'

Responses

Successful Response

Bodyapplication/json
policy_matchobjectrequired

The policy match.

approval_requestobject

The approval request.

risksArray of objectsrequired

The list of risks associated with this transaction.

notestring

An optional transaction note.

typestringrequired

The type of the transaction.

Discriminator
Value "solana_transaction"
expected_resultobjectrequired

The expected result of the transaction in case it is mined.

chainobjectrequired

The details of the chain that this message is on.

simulation_status_resultobjectrequired

Whether simulation succeeded, reverted or failed.

solana_transaction_type_detailsanyrequired

Details of the Solana transaction based on its type.

senderobjectrequired

The sender of the transaction.

suggested_feesobjectrequired

The suggested fees.

instructionsArray of objectsrequired

The instructions of the transaction.

raw_transactionstring

The serialized transaction encoded as a base64 string

Example: "SGVsbG8="
Response
application/json
{ "policy_match": { "is_default": true, "rule_id": "728c1541-d6d1-4290-9a53-cdf01dd32d60", "rule_name": "string", "action_type": "allow" }, "approval_request": { "state": "created", "quorum_size": 0, "approvers": [], "approval_groups": [], "error_message": "string" }, "risks": [ {} ], "note": "string", "type": "solana_transaction", "expected_result": { "reversion": {}, "transaction_error": "string", "fee": "1000000000000000000", "enriched_fee": {}, "effects": {}, "instruction_error": {} }, "chain": { "chain_type": "solana", "unique_id": "solana_mainnet", "name": "string", "native_currency_symbol": "ETH", "native_currency_name": "Ether", "blockchain_explorer": {}, "logo_url": "http://example.com", "is_testnet": true, "is_enabled": true }, "simulation_status_result": { "simulation_status": "success", "details": "string" }, "solana_transaction_type_details": { "type": "native_transfer", "direction": "outgoing", "sender": {}, "recipient": {}, "is_internal": true }, "sender": { "vault": {}, "explorer_url": "http://example.com", "contact": {}, "type": "solana", "address": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA", "contract": {} }, "suggested_fees": { "type": "solana", "chain_unique_id": "solana_mainnet", "fee_per_signature": "1000000000000000000" }, "instructions": [ {} ], "raw_transaction": "SGVsbG8=" }

Abort Batch Transaction

Request

Abort a batch of transactions.

Path
batch_idstring(uuid)required

ID of the batch of transactions.

curl -i -X POST \
  'https://api.fordefi.com/api/v1/batch-transactions/{batch_id}/abort' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Successful Response

Response
No content

Approve Batch Transaction

Request

Approve a batch of transactions.

Path
batch_idstring(uuid)required

ID of the batch of transactions.

curl -i -X POST \
  'https://api.fordefi.com/api/v1/batch-transactions/{batch_id}/approve' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Successful Response

Response
No content

Vaults

This resource collection represents a vault.

The vault is the basic unit to manage funds. A vault has a single public address but is multi-chain, meaning you can use it across all chains that are compatible with the address and are supported by Fordefi.

Operations

Vault Groups

This resource collection represents a vault group.

Operations

Assets

This resource collection represents assets.

  • 'Assets', in general, refer to the assets that are supported by Fordefi and can be held by an organization. The Fetch Asset Prices API, for example, returns the current prices of all the assets that are recognized by the system.
  • 'Owned assets' reflects the balance of specific assets that are owned by an organization.

Operations

End Users

This resource collection represents end users.

End users are the users of a third-party app that embeds cryptographic technology provided by Fordefi. Each end user's mobile device can have a unique key-share, where Fordefi holds the matching key-share.

Operations

User Groups

This resource collection represents user groups.

Operations

Exports

This resource collection represents asynchronous export states.

Operations

Organizations

Operations