Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Retrieve data on your organization wallets
Retrieve organization's wallets information in an inabit account, according to an organization ID variable in the query's body.
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.
Return values:
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.
query Wallets($where: WalletWhereInput) {
wallets(where: $where) {
id
name
balanceUSD
balanceEUR
walletCryptoAccounts {
name
balance
financialAsset {
code
}
blockchain {
code
}
}
}
}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 an inabit wallet in your organization
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!
Example body:
Return values:
In the mutation's response, you will receive the created API wallet ID including the associated blockchain address.
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
Fetching an existing coin/asset blockchain address within a wallet
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
GetOrCreateDepositAddresswhile 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.
Example body:
Return values:
In the query's response, you will receive the created API wallet address for the wallet, asset & blockchain IDs given in the body.
Edit your wallet name (supported on all wallet types)
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.
Example body:
Return values:
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.
Disconnect a specific exchange wallet in your organization.
Mutation to disconnect a connected exchange wallet from an organization according to the exchange wallet's ID.
Example body:
Return values:
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.
Fetching an existing coin/asset blockchain address within a wallet
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
}
}Content-Type
application/json
Authorization
Bearer <token>
address*
string
Address to be saved
contactName*
string
Existing contact's name
name*
string
Address name
organizationId
string
Organization ID
Example body:
Return values:
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.
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
}
}Adding a new coin/asset to a wallet (Generates a new wallet blockchain deposit address)
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!
Example body:
Return values:
In the query's response, you will receive the created API wallet address for the asset & blockchain given in the body.
Decide if you wish to archive / unarchive a specific wallet in your organization.
Using this endpoint, users can choose to archive or unarchive a specific wallet in their organization, according to a wallet ID.
Example body:
Return values:
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.
mutation UpdateWallet($where: WalletWhereUniqueInput!, $data: WalletUpdateInput!) {
updateWallet(where: $where, data: $data) {
id
isArchived
}
}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
}
}