# Initialize

### Obtaining Fncy AuthToken

* Link for instructions on how to get your [AuthToken](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/with-fncy/fncy-login).

### Declaring Initialization in the Application Class

```kotlin
class FncyApplication : Application() {

    override fun onCreate() {
        super.onCreate()
        FncyWalletSDK.initSDK(
            environment = Environment.Testnet // Testnet or Mainnet
        )
    }
}
```

* application: application context

### Create FncyWallet Object

```kotlin
val fncyWallet = FncyWalletSDK(token)
```

### Usding FncyWallet

```kotlin
class FncyViewModel() : ViewModel() {

    fun getWallet() {
        viewModelScope.launch {
            val fncyWallet = FncyWalletSDK("token")
            val result = fncyWallet.getWallet()
            result
                .onSuccess { wallet ->
                    // Handling Success
                }.onFailure { throwable ->
                    // Handling Fail
                }
        }
    }

} 
```

with [Paging](https://docs.fncy.world/fncy-2.0.2-eng/for-developers/wallet/sdk/etc#paging)

```kotlin
class FncyViewModel() : ViewModel() {

    fun getAssetList() {
        viewModelScope.launch {
            val wallet = FncyWalletSDK("token")
            val result = wallet.getAssetList(wid)
            result.onSuccess { it ->
                it.data // Result Data
                it.paging // Paging Data
            }.onFailure {
                ...
            }
        }
    }

} 
```
