Introduction

Welcome to the Triangle API documentation.

Authentication

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

Authentication to the API can be performed via HTTP Basic or Bearer authentication scheme. For Basic auth, provide your API key as the basic auth username value (you do not need to provide a password). For Bearer auth, provide your API key as the bearer token in the Authorization header.

Errors

This section will be updated soon.

Idempotency

The API supports idempotency so that requests can be safely retried without accidentally performing the same operation twice.

To perform an idemponent request, provide the Idempotency-Key header with a unique string (such as v4 UUIDs). If the request is valid, the request and response will be saved under the given idempotency key. Subsequent request with the same key will return the same response. Keys are scheduled to be removed automatically after they're at least 24 hours old.

All POST requests accept idempotency keys. Sending idempotency keys in all other HTTP methods are ignored.

Versioning

This section will be updated soon.

Rate Limiting

This section will be updated soon.

Chains

This is an object representing a chain.

Chains
  • Algorandalgorand
    The Algorand blockchain.
  • Aptosaptos
    The Aptos blockchain.
  • Arbitrumarbitrum
    The Arbitrum blockchain.
  • Avalanche C-Chainavalanche
    The Avalanche C-Chain blockchain.
  • Binance Smart Chainbinancesmartchain
    The Binance Smart Chain blockchain.
  • Bitcoinbitcoin
    The Bitcoin blockchain.
  • Ethereumethereum
    The Ethereum blockchain.
  • Evmosevmos
    The Evmos blockchain.
  • Fantomfantom
    The Fantom blockchain.
  • Flowflow
    The Flow blockchain.
  • Harmonyharmony
    The Harmony blockchain.
  • Optimismoptimism
    The Optimism blockchain.
  • Polygonpolygon
    The Polygon blockchain.
  • Solanasolana
    The Solana blockchain.
  • Suisui
    The Sui blockchain.
  • Terraterra
    The Terra blockchain.

The chain object

Attributes
  • idstring
    Unique identifier for the object.
  • namestring
    The name of the chain.
  • symbolstring
    The symbol of the native token.

Retrieve a chain

Retrieves the chain with the given ID.

GET /v1/chains/:id
{
  "id": "ethereum",
  "object": "chain",
  "name": "Ethereum",
  "symbol": "ETH"
}

List all chains

Returns a list of all the chains supported on Triangle.

GET /v1/chains
{
  "object": "list",
  "items": [
    {
      "id": "ethereum",
      "object": "chain",
      "name": "Ethereum",
      "symbol": "ETH"
    }
  ]
}

Networks

This is an object representing a network on a chain.

Networks
  • Algorand Mainnetalgorand_mainnet
    The Mainnet network on the Algorand blockchain.
  • Algorand Testnetalgorand_testnet
    The Testnet network on the Algorand blockchain.
  • Algorand Betanetalgorand_betanet
    The Betanet network on the Algorand blockchain.
  • Aptos Testnetarbitrum_testnet
    The Testnet network on the Aptos blockchain.
  • Arbitrum Mainnetarbitrum_mainnet
    The Mainnet network on the Arbitrum blockchain.
  • Arbitrum Rinkebyarbitrum_rinkeby
    The Rinkeby network on the Arbitrum blockchain.
  • Avalanche C-Chain Fujiavalanche_fuji
    The Fuji network on the Avalanche C-Chain blockchain.
  • Avalanche C-Chain Mainnetavalanche_mainnet
    The Mainnet network on the Avalanche C-Chain blockchain.
  • Binance Smart Chain Mainnetbinancesmartchain_mainnet
    The Mainnet network on the Binance Smart Chain blockchain.
  • Binance Smart Chain Testnetbinancesmartchain_testnet
    The Testnet network on the Binance Smart Chain blockchain.
  • Bitcoin Mainnetbitcoin_mainnet
    The Mainnet network on the Bitcoin blockchain.
  • Bitcoin Testnetbitcoin_testnet
    The Testnet network on the Bitcoin blockchain.
  • Ethereum Goerliethereum_goerli
    The Goerli network on the Ethereum blockchain.
  • Ethereum Kovanethereum_kovan
    The Kovan network on the Ethereum blockchain.
  • Ethereum Mainnetethereum_mainnet
    The Mainnet network on the Ethereum blockchain.
  • Ethereum Rinkebyethereum_rinkeby
    The Rinkeby network on the Ethereum blockchain.
  • Ethereum Ropstenethereum_ropsten
    The Ropsten network on the Ethereum blockchain.
  • Evmos Mainnetevmos_mainnet
    The Mainnet network on the Evmos blockchain.
  • Evmos Testnetevmos_testnet
    The Testnet network on the Evmos blockchain.
  • Fantom Mainnetfantom_mainnet
    The Mainnet network on the Fantom blockchain.
  • Fantom Testnetfantom_testnet
    The Testnet network on the Fantom blockchain.
  • Flow Mainnetflow_mainnet
    The Mainnet network on the Flow blockchain.
  • Flow Testnetflow_testnet
    The Testnet network on the Flow blockchain.
  • Harmony Mainnetharmony_mainnet
    The Mainnet network on the Harmony blockchain.
  • Harmony Testnetharmony_testnet
    The Testnet network on the Harmony blockchain.
  • Optimism Mainnetoptimism_mainnet
    The Mainnet network on the Optimism blockchain.
  • Optimism Kovanoptimism_kovan
    The Kovan network on the Optimism blockchain.
  • Polygon Mainnetpolygon_mainnet
    The Mainnet network on the Polygon blockchain.
  • Polygon Mumbaipolygon_mumbai
    The Mumbai network on the Polygon blockchain.
  • Solana Devnetsolana_devnet
    The Devnet network on the Solana blockchain.
  • Solana Mainnet Betasolana_mainnet_beta
    The Mainnet Beta network on the Solana blockchain.
  • Solana Testnetsolana_testnet
    The Testnet network on the Solana blockchain.
  • Sui Devnetsui_devnet
    The Devnet network on the Sui blockchain.
  • Terra Mainnetterra_mainnet
    The Mainnet network on the Terra blockchain.
  • Terra Classicterra_classic
    The Classic network on the Terra blockchain.
  • Terra Testnetterra_testnet
    The Testnet network on the Terra blockchain.

The network object

Attributes
  • idstring
    Unique identifier for the object.
  • chainChain
    Object of the chain this network is on.
  • mainnetboolean
    Whether the network is the mainnet.
  • namestring
    The name of the network.

Retrieve a network

Retrieves the network with the given ID.

GET /v1/networks/:id
{
  "id": "ethereum_mainnet",
  "object": "network",
  "chain": {
    "id": "ethereum"
  },
  "mainnet": true,
  "name": "Ethereum Mainnet"
}

List all networks

Returns a list of all the networks supported on Triangle.

GET /v1/networks
{
  "object": "list",
  "items": [
    {
      "id": "ethereum_mainnet",
      "object": "network",
      "chain": {
        "id": "ethereum"
      },
      "mainnet": true,
      "name": "Ethereum Mainnet"
    }
  ]
}

Vaults

This is an object representing a vault.

The vault object

Attributes
  • idstring
    Unique identifier for the object.
  • namestring
    The name of the vault.

Create a vault

Creates a new vault.

Body
  • namestring
    The name of the vault.
Returns
  • Returns the vault object.
POST /v1/vaults
{
  "id": "vlt_123",
  "object": "vault",
  "name": "My Ethereum Vault"
}

Retrieve a vault

Retrieves the vault with the given ID.

Retrieves a list of your vaults.

GET /v1/vaults/:id
{
  "id": "vlt_123",
  "object": "vault",
  "name": "My Ethereum Vault"
}

List all vaults

Retrieves a list of your vaults.

GET /v1/vaults
{
  "object": "list",
  "items": [
    {
      "id": "vlt_123",
      "object": "vault",
      "name": "My Ethereum Vault"
    }
  ]
}

Wallets

This is an object representing a wallet in a vault.

The wallet object

Attributes
  • idstring
    Unique identifier for the object.
  • addressstring
    The address of the wallet.
  • namestring
    The name of the wallet.
  • networkNetwork
    Object of the network this wallet is on.
  • vaultVault
    Object of the vault this wallet is in.

Create a wallet

Creates a new wallet in the given vault.

Body
  • namestring
    The name of the wallet.
  • networkstring
    ID of the network to create this wallet is on.
  • vaultstring
    ID of the vault to create this wallet is in.
Returns
  • Returns the wallet object.
POST /v1/wallets
{
  "id": "wlt_123",
  "object": "wallet",
  "address": "0x1aA7Ac26cFd5a36d3C23095b40660c44A60f60cD",
  "name": "My Ethereum Wallet",
  "network": {
    "id": "ethereum_goerli"
  },
  "vault": {
    "id": "vlt_123"
  }
}

Retrieve a wallet

Retrieves the wallet with the given ID.

GET /v1/wallets/:id
{
  "id": "wlt_123",
  "object": "wallet",
  "address": "0x1aA7Ac26cFd5a36d3C23095b40660c44A60f60cD",
  "name": "My Ethereum Wallet",
  "network": {
    "id": "ethereum_goerli"
  },
  "vault": {
    "id": "vlt_123"
  }
}

List all wallets

Retrieves a list of your wallets.

GET /v1/wallets
{
  "object": "list",
  "items": [
    {
      "id": "wlt_123",
      "object": "wallet",
      "address": "0x1aA7Ac26cFd5a36d3C23095b40660c44A60f60cD",
      "name": "My Ethereum Wallet",
      "network": {
        "id": "ethereum_goerli"
      },
      "vault": {
        "id": "vlt_123"
      }
    }
  ]
}

Retrieve a wallet's balance

Retrieves the balance of the native currency in this wallet.

GET /v1/wallets/:id/balance

List a wallet's NFTs

Retrieves a list of the NFTs in this wallet.

GET /v1/wallets/:id/nfts

List a wallet's tokens

Retrieves a list of the tokens in this wallet.

GET /v1/wallets/:id/tokens

Send a transaction

Signs a transaction using the wallet and broadcasts it to the blockchain.

Body
  • serializedstring
    The serialized transaction to send using this wallet.
Returns
  • Returns an object containing the transaction hash.
POST /v1/wallets/:id/send_transaction

Sign a transaction

Signs a transaction using the wallet without broadcasting it to the blockchain.

Body
  • serializedstring
    The serialized transaction to sign using this wallet.
Returns
  • Returns the raw transaction.
POST /v1/wallets/:id/sign_transaction

Send a raw transaction

Broadcasts a signed transaction to the blockchain.

Body
  • rawstring
    The raw transaction to send using this wallet.
Returns
  • Returns an object containing the transaction hash.
POST /v1/wallets/:id/send_raw_transaction

Sign a message

Signs a message using the wallet.

Signing messages can be used for various methods of authentication and off-chain operations (can be put on-chain if necessary). It allows you to verify that a piece of data was signed by a specific wallet and used as a way to prove that a wallet approved a message. Signing a message does not require interacting with the blockchain network.

Body
  • messagestring
    The message to sign using this wallet.
Returns
  • Returns an object containing the signature.
POST /v1/wallets/:id/sign_message