# Allowance

## &#x20;/aave/allowance

<mark style="color:green;">`POST`</mark> `https://cryptotalk-public-gateway-byeii62k.de.gateway.dev/aave/allowance`

**1)** Request body must be `JSON`\
\
**2)** Request structure sample\
`{`\
`"params" : {` \
&#x20;         `"addr" : "0xabcd...efe",`\
&#x20;         `"from_tkn" : "DAI",`\
&#x20;         `"gas" : "80",`\
&#x20;         `"amt_float" : 1.234` \
&#x20;       `}`\
`}`\
\
**3)** ***`from_tkn`*** is case sensitive\
\
**4)** Sample response contain ***`rawTx`*** object that needs to be signed and broadcast to main net. \
\
**5)** Our API automatically check which token should be allowed for which Aave smart contract. For example: aWETH should be allowed for ETH Wrapper where as other tokens must give allowance to Lending pool\
\
**6)** If allowance is already provided, ***`isAllowed`*** flag will be true

#### Query Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| key  | string | API Key     |

#### Request Body

| Name   | Type   | Description                                                                                                                                                                              |
| ------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| params | object | <p><code>{</code><br><code>"addr" : "0xabcd...efe",</code><br><code>"from\_tkn" : "DAI",</code><br><code>"gas" : "80",</code><br><code>"amt\_float" : 1.234</code><br><code>}</code></p> |

{% tabs %}
{% tab title="200 Sample response of DAI allowance" %}

```
{
  "operation": "ENABLE",
  "token": "DAI",
  "to_addr": "0x0eb4add4ba497357546da7f5d12d39587ca24606",
  "rawTx": {
    "from": "0x0eb4add4ba497357546da7f5d12d39587ca24606",
    "value": "0x0",
    "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
    "data": "0x095ea7b30000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
    "nonce": "0xe64",
    "gasLimit": "0xbe9a",
    "gasPrice": "0x12a05f2000"
  },
  "isError": false,
  "text": "Sign rawTx and broadcast to main-net",
  "isAllowed": false,
  "aave_addr": "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9"
}
```

{% endtab %}
{% endtabs %}

![Sample Request Screenshot](https://879269514-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MU4V2L84COOz3z9bK86%2F-MU9Uej7uKPMwjhGpw5m%2F-MU9V-16qmLFq_J-b-r1%2FScreen%20Shot%202021-02-23%20at%2000.05.51.png?alt=media\&token=1d7c1ac5-3daf-4ffa-bb34-8f4895ad6187)

Tool used: Insomnia or Postman
