# Apps Contracts

***Apps Contract*** is the main contract of subs apps that can be use for interaction with apps.

## **View Methods**

### getAppPayments

```solidity
function getAppPayments(uint256 _appId)
```

Returns `all app payments ids (bytes32).`

### getAppByOwner

```solidity
function getAppByOwner(address _owner)
```

Returns `all app ids by owner (uint256[]).`

## **Write Methods**

### createApp

```solidity
function createApp(
    bytes32 _name,
    Payment[] calldata _payments
)
```

Create new subs app

### deleteApp

```solidity
function deleteApp(uint _appId)
```

Delete subs app.

### addPayment

```solidity
function addPayment(uint256 _appId, Payment[] calldata _payments)
```

Add new payment to an existed app.

### deletePayment

```solidity
function deletePayment(uint256 _appId, bytes32 _paymentId)
```

Delete app Payment

### changeTokenPayment

```solidity
function changeTokenPayment(
        uint256 _appId,
        bytes32 _paymentId,
        address _oldToken,
        address _newToken,
        uint256 _newPrice,
        uint256 _firstAmount
)
```

change payment Token properties.

### modifyPayment

```solidity
function modifyPayment(
        uint256 _appId,
        bytes32 _oldPaymentId,
        bytes32 name
        address owner,
        uint256 fee,
        uint256 trialPeriod,
        uint256 loadingTime
    )
```

Change payment properties

### addTokenPaymentToMyApp

```solidity
function addTokenPaymentToMyApp(
        uint256 _appId,
        bytes32 _paymentId,
        address _newToken,
        uint256 _price,
        uint256 _firstAmount
)
```

Add new token to an existed payment

### removeTokenPaymentFromMyApp

```solidity
function removeTokenPaymentFromMyApp(
        uint256 _appId,
        bytes32 _paymentId,
        address _token
)
```

Remove existed token from a payment

### transferAppOwnership

```solidity
function transferAppOwnership(uint _appId, address _newOwner)
```

Transfer app ownership to new address

### renounceAppOwnership

```solidity
function renounceAppOwnership(uint _appId)
```

Renounce app ownership<br>
