All pages
Powered by GitBook
1 of 9

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Wallets Info

Retrieve data on your organization wallets

Fetch Organization Wallets

Retrieve organization's wallets information in an inabit account, according to an organization ID variable in the query's body.

Headers

Name
Value

Body (WalletWhereInput object)

Name
Type
Description

Example body:

How do I retrieve my organization ID?

In order to retrieve an organization's identifier, you'll need to call your user details first, to understand which organization is related to them.

Response

Return values:

Name
Type
Description

How do I retrieve my organization ID?

In order to retrieve an organization's identifier, you'll need to call your user details first, to understand which organization is related to them.

Try it out!

query Wallets($where: WalletWhereInput) {
  wallets(where: $where) {
    id
    name
    balanceUSD
    balanceEUR
    walletCryptoAccounts {
      name
      balance
      financialAsset {
        code
      }
      blockchain {
        code
      }
    }
  }
}

Wallets

balance (walletCryptoAccounts)

Integer

Balance (of a wallet's asset - per asset) ("crypto account")

code (financialAsset)

String

Financial Asset Code

code (blockchain)

String

Blockchain Code

Content-Type

application/json

Authorization

Bearer <token>

id*

string

Organization ID

id

String

Wallet ID

name

Integer

Wallet Name

balanceUSD

String

Balance in USD

balanceEUR

String

Balance in Euro

{
  "where": {
    "organization": {
      "id": "cljzumgxa0009k603wl8foc6z"
    }
  }
}
query User($where: UserWhereUniqueInput!) {
  user(where: $where) {
    fullName
    organizations {
      name
      id
    }
  }
}
{
  "data": {
    "wallets": [
      {
        "id": "clllyfdl8007jbtqksgcgx1wy",
        "name": "Wallet 1",
        "balanceUSD": 0,
        "balanceEUR": 0,
        "walletCryptoAccounts": []
      },
      {
        "id": "clnleemkg0000780172yr8115",
        "name": "Wallet 2",
        "balanceUSD": 0,
        "balanceEUR": 0,
        "walletCryptoAccounts": []
      },
      {
        "id": "cln1qt5p400005b012sohm0sx",
        "name": "Wallet 3",
        "balanceUSD": 0,
        "balanceEUR": 0,
        "walletCryptoAccounts": []
      },
      {
        "id": "cln1p10nm00006b016ow1abpj",
        "name": "Wallet 4",
        "balanceUSD": 305.41,
        "balanceEUR": 301.96,
        "walletCryptoAccounts": [
          {
            "balance": 0.05591,
            "financialAsset": {
              "code": "ETH"
            },
            "blockchain": {
              "code": "ethereum"
            }
          }
        ]
      }
{
  "errors": [
    {
      "message": "Unauthorized",
      "extensions": {
        "code": "UNAUTHENTICATED",
        "response": {
          "statusCode": 401,
          "message": "Unauthorized"
        }
      }
    }
  ],
  "data": {
    "transaction": null
  }
}
query User($where: UserWhereUniqueInput!) {
  user(where: $where) {
    fullName
    organizations {
      name
      id
    }
  }
}

Create inabit Wallet

Create an inabit wallet in your organization

Generate an inabit Wallet

The CreateWalletWithInabit mutation allows API admins to create a new inabit wallet (that is accessible in the platform's interface, unlike API wallets) with a designated address for a given asset & blockchain.

Remember to authenticate to call our GraphQL API using an access token (bearer) with your API Admin credentials. (If you're not sure how, refer to Authentication)

Don't have an API Admin user yet? contact us at [email protected] to create one!

Headers

Name
Value

Body (WalletCreateWithInabitInput object)

Name
Type
Description

Example body:

Response

Return values:

Name
Type
Description

In the mutation's response, you will receive the created API wallet ID including the associated blockchain address.

Generating API wallet is different than this mutation of creating a regular inabit wallet. API wallets generation are wallets created that are blockchain & address specific, as well as aren't accessible via the platform's interface.

Unlike API wallets, inabit wallets created with this mutation can be accessed through the interface as well as have multiple blockchains and addresses generated.

Visit the section to learn more.

Try it out!

mutation CreateWalletWithInabit($data: WalletCreateWithInabitInput!) {
  createWalletWithInabit(data: $data) {
    id
    name
  }
}

Content-Type

application/json

Authorization

Bearer <token>

name*

string

Name of the wallet

organizationId*

string

ID of the organization in inabit

id

String

Created Wallet ID

name

String

Created Wallet Name

API Wallets Generation

Fetch Deposit Address

Fetching an existing coin/asset blockchain address within a wallet

Get an Existing Wallet Deposit Address

The GetOrCreateDepositAddress query allows API users to fetch an existing blockchain address for an asset & blockchain in their wallet. If there isn't one, the query will return an error and you will need to use Generate Deposit Address query beforehand to add a coin first.

Do note that currently, this query is called GetOrCreateDepositAddress while in fact this query cannot create/generate a new blockchain deposit address for a wallet. This confusion will be fixed and deprecated in future versions of the API.

Headers

Name
Value

Body (WalletDepositAddressWhereInput object)

Name
Type
Description

Example body:

Response

Return values:

Name
Type
Description

In the query's response, you will receive the created API wallet address for the wallet, asset & blockchain IDs given in the body.

Try it out!

Edit Wallet Name

Edit your wallet name (supported on all wallet types)

Edit a Wallet's Name

Edit a specific wallet's name in your organization according to a specific wallet ID. Please note that a wallet name can take up to 32 characters maximum.

Headers

Name
Value

Body (WalletWhereUniqueInput object) + (WalletUpdateInput object)

Name
Type
Description

Example body:

Response

Return values:

Name
Type
Description

Using this endpoint users can edit any wallet's name within their organization wallets.

How do I retrieve my wallet ID?

In order to retrieve an organization's wallet ID, you'll need to call your organization wallets query first, to fetch the wallet's ID. The query below accepts a WalletWhereInput of an organizationId, and retrieves the wallet's ID and name in the response.

Try it out!

Disconnect Exchange Wallet

Disconnect a specific exchange wallet in your organization.

Disconnect an Exchange Wallet

Mutation to disconnect a connected exchange wallet from an organization according to the exchange wallet's ID.

Note that this mutation can only occur on a wallet marked as "Exchange wallet" in its type.

Headers

Name
Value

Body (walletId object)

Name
Type
Description

Example body:

Response

Return values:

Name
Type
Description

How do I retrieve my wallet ID?

In order to retrieve an organization's wallet ID, you'll need to call your organization wallets query first, to fetch the wallet's ID. The query below accepts a WalletWhereInput of an organizationId, and retrieves the wallet's ID and name in the response.

Try it out!

Save Address to Whitelist

Fetching an existing coin/asset blockchain address within a wallet

Adding/Saving an Address to The Whitelist

The CreateContactCryptoAccount mutation allows API users to save an un-recognized address to the contact's whitelist. This action essentially means that you can name an address while labeling it to an existing contact in the organization.

The contact must exist first, in order to create a new contact, follow the steps in the page..

{
  "data": {
    "name": "My Inabit Wallet",
    "organization": {
      "id": "clu6oj0kg0004r4ub98guo82u"
    }
  }
}
{
  "data": {
    "createWalletWithInabit": {
      "id": "clvw5p0oj000er47qhe3atv9d",
      "name": "My Inabit Wallet",
    }
  }
}
{
  "error": "Invalid request"
}
mutation UpdateWallet($where: WalletWhereUniqueInput!, $data: WalletUpdateInput!) {
  updateWallet(where: $where, data: $data) {
    id
    name
  }
}
mutation DisconnectWallet($walletId: String!) {
  disconnectWallet(walletId: $walletId) {
    success
  }
}
Headers
Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body (ContactCryptoAccountCreateInput object)

Name
Type
Description

address*

string

Address to be saved

contactName*

string

Existing contact's name

name*

string

Address name

organizationId

string

Organization ID

Example body:

Response

Return values:

Name
Type
Description

address

String

API Wallet Address

In the query's response, you will receive the created API wallet address for the wallet, asset & blockchain IDs given in the body.

Try it out!

Create New Contact

Content-Type

application/json

Authorization

Bearer <token>

walletId*

string

ID of the wallet

financialAssetId*

string

ID of the financial asset in inabit (can be token/native)

blockchainId*

string

ID of the blockchain in inabit

address

String

API Wallet Address

Content-Type

application/json

Authorization

Bearer <token>

walletId*

String

Wallet ID

walletName*

String

Wallet's New name

id

String

Wallet ID

name

String

Updated Wallet Name

Content-Type

application/json

Authorization

Bearer <token>

id*

String

Wallet ID

success

Boolean

Returns true if disconnect was successful, else false

{
  "data": {
    "createContactCryptoAccount": {
      "address": "0x39be337b9c1e91182d9c2c0e63233e9f2db4d9dd",
      "name": "Test address name",
      "contact": {
        "id": "clvmgp4h1002j88014aw1k6uf",
        "name": "Test Contact"
      },
      "id": "clvmgp4h1002h8801lx7oyycg"
    }
  }
}
{
  "error": "Invalid request"
}
mutation CreateContactCryptoAccount($data: ContactCryptoAccountCreateInput!) {
  createContactCryptoAccount(data: $data) {
    address
    name
    contact {
      id
      name
    }
    id
  }
}
{
  "data": {
    "address": "0x39be337b9c1e91182d9c2c0e63233e9f2db4d9dc",
    "contactName": "Example Tests",
    "name": "Test address",
    "organizationId": "clllyfclz0007btqk0iigw1n1"
  }
}
query GetOrCreateDepositAddress($where: WalletDepositAddressWhereInput!) {
  getOrCreateDepositAddress(where: $where) {
    address
  }
}
{
  "where": {
    "walletId": "clmq35x0400009k01v5ptn7d5",
    "assetId": "clefn78h5012plc6rxbmofnop",
    "blockchainId": "clefn78cl00i3lc6rih442mx9"
  }
}
{
  "data": {
    "getOrCreateDepositAddress": {
      "address": "0x429de487cF185eFBBEb3158D2FbC1C003462018c",
    }
  }
}
{
  "error": "Invalid request"
}
{
  "where": {
    "id": "clllyfdk6006ybtqkwk840uei"
  },
  "data": {
    "name": "New Wallet Name"
  }
}
{
  "data": {
    "updateWallet": {
      "id": "clllyfdk6006ybtqkwk840uei",
      "name": "New Wallet Name"
    }
  }
}
query Wallets($where: WalletWhereInput) {
  wallets(where: $where) {
    id
    name
  }
}
{
  "walletId": "clpgvhulg000f6s0171foixj6"
}
{
  "data": {
    "disconnectWallet": {
      "success": true,
    }
  }
}
query Wallets($where: WalletWhereInput) {
  wallets(where: $where) {
    id
    name
  }
}

Generate Deposit Address

Adding a new coin/asset to a wallet (Generates a new wallet blockchain deposit address)

Adding a New Coin to a Wallet

The AddCoinAddress query allows API users to add a new coin into their API wallet/s. This action will generate a new blockchain address in the wallet.

Remember to authenticate to call our GraphQL API using an access token (bearer) with your API Admin credentials. (If you're not sure how, refer to Authentication)

Don't have an API Admin user yet? contact us at [email protected] to create one!

Headers

Name
Value

Body (WalletDepositAddressWhereInput object)

Name
Type
Description

Example body:

Response

Return values:

Name
Type
Description

In the query's response, you will receive the created API wallet address for the asset & blockchain given in the body.

Reminder - You can't add multiple blockchains under the same API wallet. One inabit API wallet = one address

Try it out!

Archive / Unarchive Wallet

Decide if you wish to archive / unarchive a specific wallet in your organization.

Archive / Unarchive a Wallet

Using this endpoint, users can choose to archive or unarchive a specific wallet in their organization, according to a wallet ID.

Note that this mutation is supported across all wallet types. (inabit, exchanges, web3)

Headers

Name
Value

Body (WalletWhereUniqueInput object) + (WalletUpdateInput object)

Name
Type
Description

Example body:

Response

Return values:

Name
Type
Description

How do I retrieve my wallet ID?

In order to retrieve an organization's wallet ID, you'll need to call your organization wallets query first, to fetch the wallet's ID. The query below accepts a WalletWhereInput of an organizationId, and retrieves the wallet's ID and name in the response.

Try it out!

mutation UpdateWallet($where: WalletWhereUniqueInput!, $data: WalletUpdateInput!) {
  updateWallet(where: $where, data: $data) {
    id
    isArchived
  }
}
Apollo Studiostudio.apollographql.com

Content-Type

application/json

Authorization

Bearer <token>

walletId*

string

ID of the wallet

financialAssetId*

string

ID of the financial asset in inabit (can be token/native)

blockchainId*

string

ID of the blockchain in inabit

address

String

API Wallet Address

Content-Type

application/json

Authorization

Bearer <token>

Id*

String

Wallet ID

isArchived*

Boolean

Archived or not (flag)

Id*

String

Wallet ID

isArchived*

Boolean

Archived or not (flag)

query AddCoinAddress($where: WalletDepositAddressWhereInput!) {
  addCoinAddress(where: $where) {
    address
  }
}
{
  "where": {
    "walletId": "clvm13aa70003phy2n5j7ece9",
    "assetId": "clefn78h5012plc6rxbmofnop",
    "blockchainId": "clefn78cl00i3lc6rih442mx9"
  }
}
{
  "data": {
    "addCoinAddress": {
      "address": "0xca832a87caf09dcecdbe4d3bda46d67da53b69f5",
    }
  }
}
{
  "error": "Invalid request"
}
{
  "where": {
    "id": "clllyfdk6006ybtqkwk840uei"
  },
  "data": {
    "isArchived": true
    }
}
{
  "data": {
    "updateWallet": {
      "id": "clpgvhulg000f6s0171foixj6",
      "isArchived": true,   // false for unArchived
    }
  }
}
query Wallets($where: WalletWhereInput) {
  wallets(where: $where) {
    id
    name
  }
}
Apollo Studiostudio.apollographql.com
Apollo Studiostudio.apollographql.com
Apollo Studiostudio.apollographql.com
Apollo Studiostudio.apollographql.com
Apollo Studiostudio.apollographql.com
Apollo Studiostudio.apollographql.com
Apollo Studiostudio.apollographql.com