# Wallet ## Get user portfolio **get** `/api/v1/users/{address}/wallet/balances` Get user portfolio ### Path Parameters - `address: string` The user account address ### Query Parameters - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: UserWalletPortfolio` - `balances: array of WalletBalance` Array of each wallet balance - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `id: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `values: WalletAsset` Derived values and amounts. - `WalletAssetKnown = object { amount, amount_scaled, asset_info, 2 more }` - `amount: string` Wallet balance in native denom. - `amount_scaled: string` Amount scaled to the asset's standard unit / decimal places. - `asset_info: AssetInfo` Asset identifiers with associated metadata - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "neptune_receipt_token"` - `"neptune_receipt_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `kind: "known"` - `"known"` - `WalletAssetUnknown = object { amount, kind }` - `amount: string` Wallet balance in native denom. - `kind: "unknown"` - `"unknown"` - `extra: object { text }` - `text: object { total_value }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `total_value: string` - `total_value: string` Sum value in USD. Guaranteed null if value calculation is disabled / guaranteed non-null if calculation is enabled. **NOTE:** this only accounts for assets which are internally known & tracked. See the `/assets` endpoint for a list of supported assets. - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/wallet/balances ``` #### Response ```json { "data": { "balances": [ { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "values": { "kind": "known", "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "amount": "375425343522854919091", "amount_scaled": "375.425343522854919091", "extra": { "text": { "amount": "375.4253 INJ" }, "value": { "amount": "1125.656578751752046656", "price": "2.99835", "extra": { "text": { "price": "$2.99", "amount": "$1,125.65" } } } } } } ], "total_value": "626.552120573717882332", "extra": { "text": { "total_value": "$626.55" } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get user balance by asset **get** `/api/v1/users/{address}/wallet/balance` Get user balance by asset ### Path Parameters - `address: string` The user account address ### Query Parameters - `asset_id: string` Asset ID for lookup - `with_text: optional boolean` Include text variation fields - `with_value: optional boolean` Calculate and include USD values for amounts, where applicable ### Returns - `data: WalletBalance` Asset and balance contents for a given wallet - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `id: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `values: WalletAsset` Derived values and amounts. - `WalletAssetKnown = object { amount, amount_scaled, asset_info, 2 more }` - `amount: string` Wallet balance in native denom. - `amount_scaled: string` Amount scaled to the asset's standard unit / decimal places. - `asset_info: AssetInfo` Asset identifiers with associated metadata - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "neptune_receipt_token"` - `"neptune_receipt_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `kind: "known"` - `"known"` - `WalletAssetUnknown = object { amount, kind }` - `amount: string` Wallet balance in native denom. - `kind: "unknown"` - `"unknown"` - `error: unknown` Error data. Guaranteed `null` for successful response. - `status: number` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: string` HTTP status text ### Example ```http curl https://api-v2.nept.finance/api/v1/users/$ADDRESS/wallet/balance ``` #### Response ```json { "data": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "values": { "kind": "known", "asset_info": { "asset": { "id": "native;inj", "group": "native", "group_key": "inj" }, "metadata": { "name": "Injective", "symbol": "INJ", "symbol_denom": "inj", "decimals_denom": 18, "decimals_display": 4 }, "classification": { "kind": "regular", "neptune_receipt_asset": { "id": "token;inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f", "group": "token", "group_key": "inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f" } } }, "amount": "121433424019244729044", "amount_scaled": "121.433424019244729044", "extra": { "text": { "amount": "121.4334 INJ" }, "value": { "amount": "364.099906908102433329", "price": "2.99835", "extra": { "text": { "price": "$2.99", "amount": "$364.09" } } } } } }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### User Wallet Portfolio - `UserWalletPortfolio = object { balances, extra, total_value }` - `balances: array of WalletBalance` Array of each wallet balance - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `id: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `values: WalletAsset` Derived values and amounts. - `WalletAssetKnown = object { amount, amount_scaled, asset_info, 2 more }` - `amount: string` Wallet balance in native denom. - `amount_scaled: string` Amount scaled to the asset's standard unit / decimal places. - `asset_info: AssetInfo` Asset identifiers with associated metadata - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "neptune_receipt_token"` - `"neptune_receipt_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `kind: "known"` - `"known"` - `WalletAssetUnknown = object { amount, kind }` - `amount: string` Wallet balance in native denom. - `kind: "unknown"` - `"unknown"` - `extra: object { text }` - `text: object { total_value }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `total_value: string` - `total_value: string` Sum value in USD. Guaranteed null if value calculation is disabled / guaranteed non-null if calculation is enabled. **NOTE:** this only accounts for assets which are internally known & tracked. See the `/assets` endpoint for a list of supported assets. ### Wallet Asset - `WalletAsset = WalletAssetKnown or WalletAssetUnknown` - `WalletAssetKnown = object { amount, amount_scaled, asset_info, 2 more }` - `amount: string` Wallet balance in native denom. - `amount_scaled: string` Amount scaled to the asset's standard unit / decimal places. - `asset_info: AssetInfo` Asset identifiers with associated metadata - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `id: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "neptune_receipt_token"` - `"neptune_receipt_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `kind: "known"` - `"known"` - `WalletAssetUnknown = object { amount, kind }` - `amount: string` Wallet balance in native denom. - `kind: "unknown"` - `"unknown"` ### Wallet Asset Known - `WalletAssetKnown = object { amount, amount_scaled, asset_info, 2 more }` - `amount: string` Wallet balance in native denom. - `amount_scaled: string` Amount scaled to the asset's standard unit / decimal places. - `asset_info: AssetInfo` Asset identifiers with associated metadata - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `id: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "neptune_receipt_token"` - `"neptune_receipt_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `kind: "known"` - `"known"` ### Wallet Asset Unknown - `WalletAssetUnknown = object { amount, kind }` - `amount: string` Wallet balance in native denom. - `kind: "unknown"` - `"unknown"` ### Wallet Balance - `WalletBalance = object { asset, values }` Asset and balance contents for a given wallet - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `id: string` - `group: "native" or "token"` - `"native"` - `"token"` - `group_key: string` - `values: WalletAsset` Derived values and amounts. - `WalletAssetKnown = object { amount, amount_scaled, asset_info, 2 more }` - `amount: string` Wallet balance in native denom. - `amount_scaled: string` Amount scaled to the asset's standard unit / decimal places. - `asset_info: AssetInfo` Asset identifiers with associated metadata - `asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `classification: AssetClassification` The asset's classification metadata. Assets are classfied to provide context on their usage throughout the Neptune API (e.g. regular assets, neptune receipt tokens, LSTs, etc.) Each asset belongs to only a single classification type. This object contains metadata pertaining to the given classification. While some fields may be common among the distinct classifcations, each classification is distinct and subject to independent change. - `Regular = object { kind, neptune_receipt_asset }` - `kind: "regular"` - `"regular"` - `neptune_receipt_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `NeptuneReceiptToken = object { kind, origin_asset }` - `kind: "neptune_receipt_token"` - `"neptune_receipt_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `LiquidStakingToken = object { kind, origin_asset }` - `kind: "liquid_staking_token"` - `"liquid_staking_token"` - `origin_asset: AssetSpec` Provides a unique identifier for an asset for use throughout the Neptune API. IDs are unique across asset domains (contract tokens, native denoms, etc) - `metadata: AssetMetadata` Additional metadata for assets - `decimals_denom: number` Denom exponent, or num. of decimal places that shift between denom/standard amounts (e.g. `18` for `INJ`) - `decimals_display: number` Number of decimals used when displaying amounts of this asset (this is subjective and used for generating text representations) - `name: string` Full name of the asset - `symbol: string` Symbol of the asset, e.g.: `NEPT` `INJ` - `symbol_denom: string` Denom symbol for the asset (e.g. `inj` for `INJ`, `sat` for `BTC`) - `extra: object { text, value }` - `text: object { amount }` Human-readable field variants. Will not be null when query param `with_text` is `true`. - `amount: string` - `value: object { amount, extra, price }` USD values for the corresponding amounts above. Will not be null when query param `with_value` is `true`. ### Note This variant group contains an additional `price` field (set to the number used in value calculation). The embedded text group will contain the text variant if `with_text` was specified as well. - `amount: string` - `extra: object { text }` - `text: object { amount, price }` Human-readable variants of USD values. Will not be null when query params `with_text` and `with_value` are `true`. - `amount: string` - `price: string` Text representation of price - `price: string` Price used in value calculations - `kind: "known"` - `"known"` - `WalletAssetUnknown = object { amount, kind }` - `amount: string` Wallet balance in native denom. - `kind: "unknown"` - `"unknown"`