> For the complete documentation index, see [llms.txt](https://cylexdev.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cylexdev.gitbook.io/docs/cylex-phone/exports-and-events/server-exports/bank.md).

# Bank

#### getBankData <a href="#user-content-getbankdata" id="user-content-getbankdata"></a>

```lua
-- identifier: string - target identifier
-- return: table

-- Returns a table containing:
-- "transactions" (table)
-- "myCrypto" (table)

local bankData = exports['cylex_phone']:getBankData(identifier)
```

#### setBankData <a href="#user-content-setbankdata" id="user-content-setbankdata"></a>

```lua
-- identifier: string - target identifier
-- key: string - data key to update
-- value: any - new value
-- return: none

-- Keys you can safely update: 
-- "myCrypto" (table) -> Format: { ['btc'] = 1.5, ['eth'] = 0.5 }

exports['cylex_phone']:setBankData(identifier, key, value)

```

#### addTransaction <a href="#user-content-addtransaction" id="user-content-addtransaction"></a>

```lua
-- identifier: string - target identifier
-- value: table - transaction details
-- return: none

-- Transaction table expects:
-- "reciever" (string/optional), "amount" (number), "user" (string), 
-- "type" (string - 'deposit'/'withdraw'), "date" (number), 
-- "description" (string), "id" (string/iban)

local transactionData = {
    reciever = "TR123456789",
    amount = 500,
    user = "John Doe",
    type = "deposit",
    date = os.time(),
    description = "Salary",
    id = "TR123456789"
}

exports['cylex_phone']:addTransaction(identifier, transactionData)
```
