# Wallet

{% hint style="danger" %}
Most of the wallet functionality is insecure / meant for development testing. To connect Wallets with Dapps/Dgames securely, we bring the open communications protocol for web3 into Unreal Engine. Please check [WalletConnect](https://docs.cronos.org/~/changes/416/cronos-play/getting-started_unreal/quick-start/walletconnect).
{% endhint %}

The following functions are members of **DefiWalletCoreActor**. The Target should be **Defi Wallet Core Actor**.

### RestoreWallet

Restore wallet with mnemonics and password.

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-1396e2f10484815a06fc1ae21500b7fdff53659f%2Fcronos-gamefi-blueprint-RestoreWallet.png?alt=media&#x26;token=943ec7b8-45b8-4d1e-bd56-19e9ff965d42" alt=""><figcaption></figcaption></figure>

* `Mnemonics`: mnemonics to restore
* `Password`: salt in mnemonics restoration
* `Output`: generated address (index=0)
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed

## InitializeNewWallet

Create a new wallet with password and wordcount.

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-199592e40fb9cdf319b7c66f0ffe983f247f9a0b%2Fcronos-gamefi-blueprint-InitializeNewWallet.png?alt=media&#x26;token=2ebf2e1e-3f1a-4656-b1a1-de0a04a754f3" alt=""><figcaption></figcaption></figure>

* `Password`: salt in mnemonics restoration
* `Wordcount`: mnemonics word count (12, 18, 24)
* `Output`: generated address (index=0)
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed

## GetBackupMnemonicPhrase

Get backup mnemonic phrase.

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-9498abdd178ed0bb71466020b39699af69807c37%2Fimage%20(18)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

* `Output`: backup mnemonics
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed

## GenerateMnemonics

Generate mnemonics.

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-91e68c2f86f08a1a0514aa33af3e96db2d343300%2Fcronos-gamefi-blueprint-GenerateMnemonics.png?alt=media&#x26;token=53a79bbe-0ded-4817-b5ad-46501907fad3" alt=""><figcaption></figcaption></figure>

* `Password`: salt in mnemonics restoration
* `Wordcount`: mnemonics word count (12, 18, 24)
* `Output`: generated mnemonics
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed

## GetEthAddress

Get eth address with index

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-8554e3ac2a95effa3720b5b22d39f6e3f3c11628%2Fimage%20(27).png?alt=media" alt=""><figcaption></figcaption></figure>

* `Index`: wallet index which starts from 0
* `Output`: get eth address
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed

## GetEthBalance

Get eth balance

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-3b8d261117846b6db9ba55a1504328a80c3a1e5e%2Fimage%20(22)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

* `Address`: eth address
* `Output`: get balance
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed

## SignEthAmount

Sign eth amount

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-23415088b1a23bbbfa373c15d0531dc3a76fb358%2Fimage%20(13)%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

* `Wallet Index`: wallet index which starts from 0
* `Fromaddress`: sender address
* `Toaddress`: receiver address
* `Amount`: amount in eth decimal, eg. 0.1 means 0.1 eth
* `Gas Limit`: gas limit, fee= gasLimit \* gasPrice
* `Gas Price`: gas price in wei, eg. 1wei= 1/(10^18)eth 1wei=1/(10^9)gwei
* `Txdata`: optional data
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed
* `Return Value`: signed transaction as bytes

## SendEthAmount

Send eth amount

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-bb43a425f39d29c8a635380b8b94ea2b160971c0%2Fcronos-gamefi-blueprint-SendEthAmount.png?alt=media" alt=""><figcaption></figcaption></figure>

* `Wallet Index`: wallet index which starts from 0
* `Fromaddress`: sender address
* `Toaddress`: receiver address
* `Amount in Eth Decimal`: amount in eth decimal, eg. 0.1 means 0.1 eth
* `Gas Limit`: gas limit, fee= gasLimit \* gasPrice
* `Gas Price in Wei`: gas price in wei, eg. 1wei= 1/(10^18)eth 1wei=1/(10^9)gwei
* `Txdata`: optional data
* `Out`: SendEthAmount callback

## SignLogin

Sign eth login

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-f31504a6ccdd6c18e6c8a12a66e92233d32bc2fe%2Fimage%20(16)%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

* `Wallet Index`: wallet index which starts from 0
* `Document`: document to sign
* `Signature`: get signature
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed

## VerifyLogin

Verify eth login

<figure><img src="https://1786307500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqXsIo4b4WtOTfICyOIxa%2Fuploads%2Fgit-blob-20c57a8524e0d4a355543d9f0f1f63839bcd7e1c%2Fimage%20(20).png?alt=media" alt=""><figcaption></figcaption></figure>

* `Document`: document to verify
* `Signature`: signature to verify
* `Success`: whether succeed or not
* `Output Message`: error message, "" if succeed
