# Wallets

*All methods imply that you've called `updateToken` method*

## Wallets

`Wallet` object needs to be obtained first to get any info about wallets of user:

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
val mercuryo = Mercuryo.create(...)
val wallet = mercuryo.wallet
```

{% endtab %}

{% tab title="Swift" %}

```swift
var mercuryoSDK: IMercuryo = IMercuryo(isDebug: true, baseHost: "HOST_HERE")
var wallet = mercuryoSDK.wallet
```

{% endtab %}
{% endtabs %}

## Available balances

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
wallet.getWallets(): List<Wallet>
```

{% endtab %}

{% tab title="Swift" %}

```swift
wallet.getWallets { wallets, error in
    // do some magic here...
}
```

{% endtab %}
{% endtabs %}

<div align="left"><img src="https://1054688193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTteOf7XXaHz5V5_paW%2F-MTuCcFfvjBGxm2rMZI3%2F-MTuGAB1J4QWimqBCAJ9%2Fwallet%20(1).png?alt=media&#x26;token=9546dea3-6db3-427b-8ff7-cceb21c1492c" alt=""></div>

## Getting address of wallet

Let user top up specific wallet providing an address.

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
wallet.getWalletsAddress(crypto: String): String
```

{% endtab %}

{% tab title="Swift" %}

```swift
wallet.getWalletAddress(crypto: "BTC") { address, error in
    //do some magic here    
}
```

{% endtab %}
{% endtabs %}

## Getting transactions of wallet

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
wallet.getTransactions(type: TransactionType?, limit: Int, offset: Int, currency: String?): List<Transaction> 
```

{% endtab %}

{% tab title="Swift" %}

```swift
wallet.getTransactions(type: <TransactionType?>, limit: <Int>, offset: <Int>, currency: <String>) { transactions, error in
    //do some magic here
}
```

{% endtab %}
{% endtabs %}

<div align="left"><img src="https://1054688193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTteOf7XXaHz5V5_paW%2F-MTuCcFfvjBGxm2rMZI3%2F-MTuGnKxP5ADsD9X2d9H%2Ftransactions.png?alt=media&#x26;token=0045d164-11ab-4cf1-be96-f0218e1ccf66" alt=""></div>

Filters are available for the wallet:

* `type` - [`TransactionType`](https://mercuryo.gitbook.io/reference-en/#transactiontype), if `type == null` is passed then transactions of all available types are returned;
* `limit` - max amount of transations, default is 20;
* `offset` - offset from the start;
* `currency` - filter by crypto, the following choices are available: (`BTC`,`ETH`,`BAT`,`USDT`,`ALGO`,`TRX`,`OKB`,`BCH`,`DAI`), if `currency == null` is passed then transactions of all currencies are returned.
