# Blockchain On-Ramp Transfers
> Blockchain On-Ramp Transfers move funds from an Account to a blockchain address.

[Events](https://increase.com/documentation/events.md) will be generated for this resource. The possible event categories are: `blockchain_onramp_transfer.created` and `blockchain_onramp_transfer.updated`.

## The Blockchain On-Ramp Transfer object
### Example
```json
{
  "account_id": "account_in71c4amph0vgo2qllky",
  "amount": 10000,
  "blockchain": "ethereum",
  "confirmation": {
    "confirmed_at": "2020-01-31T23:59:59Z",
    "transaction_hash": "0xcd7c2ab9e2075a3be3740c3a1f6e6e2c112e37d6b3f4a15e9e3e5a93b82c2c0a"
  },
  "created_at": "2020-01-31T23:59:59Z",
  "created_by": {
    "category": "user",
    "user": {
      "email": "user@example.com"
    }
  },
  "description": "Moving funds on-chain",
  "destination_blockchain_address": "0xaabbccdd",
  "id": "blockchain_onramp_transfer_sg8nzy569rk0dnfk28bv",
  "idempotency_key": null,
  "pending_transaction_id": null,
  "status": "confirmed",
  "token": "usdc",
  "transaction_id": "transaction_uyrp7fld2ium70oa7oi",
  "type": "blockchain_onramp_transfer"
}
```
### Attributes
- `account_id` (string)
  The Account from which the transfer was sent.

- `amount` (integer)
  The transfer amount in USD cents.

- `blockchain` (enum)
  The blockchain network.
  Cases:
  * `ethereum` (The Ethereum blockchain.)
  * `base` (The Base blockchain.)
  * `solana` (The Solana blockchain.)

- `confirmation` (dictionary, nullable)
  If the transfer is confirmed, this will contain details of the confirmation.

  - `confirmation.confirmed_at` (string)
    The ISO 8601 date and time when the transfer was confirmed.

  - `confirmation.transaction_hash` (string)
    The hash of the confirmed transaction on the blockchain.

- `created_at` (string)
  The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the transfer was created.

- `created_by` (dictionary, nullable)
  What object created the transfer, either via the API or the dashboard.

  - `created_by.api_key` (dictionary, nullable)
    If present, details about the API key that created the transfer.

      - `created_by.api_key.description` (string, nullable)
        The description set for the API key when it was created.

  - `created_by.category` (enum)
    The type of object that created this transfer.
    Cases:
    * `api_key` (An API key. Details will be under the `api_key` object.)
    * `oauth_application` (An OAuth application you connected to Increase. Details will be under the `oauth_application` object.)
    * `user` (A User in the Increase dashboard. Details will be under the `user` object.)

  - `created_by.oauth_application` (dictionary, nullable)
    If present, details about the OAuth Application that created the transfer.

      - `created_by.oauth_application.name` (string)
        The name of the OAuth Application.

  - `created_by.user` (dictionary, nullable)
    If present, details about the User that created the transfer.

      - `created_by.user.email` (string)
        The email address of the User.

- `description` (string, nullable)
  A description you provided for the transfer.

- `destination_blockchain_address` (string)
  The blockchain address the funds are being sent to.

- `id` (string)
  The Blockchain On-Ramp Transfer's identifier.

- `idempotency_key` (string, nullable)
  The idempotency key you chose for this object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

- `pending_transaction_id` (string, nullable)
  The ID for the pending transaction representing the transfer while it is pending.

- `status` (enum)
  The lifecycle status of the transfer.
  Cases:
  * `pending_reviewing` (The transfer is pending review by Increase.)
  * `pending_submission` (The transfer is pending submission to the blockchain.)
  * `pending_confirmation` (The transfer has been submitted and is pending confirmation on the blockchain.)
  * `confirmed` (The transfer has been confirmed on the blockchain.)
  * `rejected` (The transfer was rejected by Increase. This happens extremely rarely, in exceptional circumstances.)

- `token` (enum)
  The token being transferred.
  Cases:
  * `usdc` (A USD stablecoin issued by Circle.)

- `transaction_id` (string, nullable)
  The Transaction funding the transfer once it is complete.

- `type` (string)
  A constant representing the object's type. For this resource it will always be `blockchain_onramp_transfer`.

## List Blockchain On-Ramp Transfers
GET /blockchain_onramp_transfers

### Example
```curl
curl \
  --url "${INCREASE_URL}/blockchain_onramp_transfers?account_id=account_in71c4amph0vgo2qllky" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```

### Query Parameters
- `cursor` (string, optional)
  Return the page of entries after this one.

- `limit` (integer, optional)
  Limit the size of the list that is returned. The default (and maximum) is 100 objects.

- `account_id` (string, optional)
  Filter Blockchain On-Ramp Transfers to those belonging to the specified Account.

- `idempotency_key` (string, optional)
  Filter records to the one with the specified `idempotency_key` you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys).

- `status.in` (array of enums, optional)
  Return results whose value is in the provided list. For GET requests, this should be encoded as a comma-delimited string, such as `?in=one,two,three`.
  Cases:
  * `pending_reviewing` (The transfer is pending review by Increase.)
  * `pending_submission` (The transfer is pending submission to the blockchain.)
  * `pending_confirmation` (The transfer has been submitted and is pending confirmation on the blockchain.)
  * `confirmed` (The transfer has been confirmed on the blockchain.)
  * `rejected` (The transfer was rejected by Increase. This happens extremely rarely, in exceptional circumstances.)

- `created_at.after` (string, optional)
  Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.before` (string, optional)
  Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_after` (string, optional)
  Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

- `created_at.on_or_before` (string, optional)
  Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.

### Returns a Blockchain On-Ramp Transfer List object:
```json
{
  "data": [
    {
      "account_id": "account_in71c4amph0vgo2qllky",
      "amount": 10000,
      "blockchain": "ethereum",
      "confirmation": {
        "confirmed_at": "2020-01-31T23:59:59Z",
        "transaction_hash": "0xcd7c2ab9e2075a3be3740c3a1f6e6e2c112e37d6b3f4a15e9e3e5a93b82c2c0a"
      },
      "created_at": "2020-01-31T23:59:59Z",
      "created_by": {
        "category": "user",
        "user": {
          "email": "user@example.com"
        }
      },
      "description": "Moving funds on-chain",
      "destination_blockchain_address": "0xaabbccdd",
      "id": "blockchain_onramp_transfer_sg8nzy569rk0dnfk28bv",
      "idempotency_key": null,
      "pending_transaction_id": null,
      "status": "confirmed",
      "token": "usdc",
      "transaction_id": "transaction_uyrp7fld2ium70oa7oi",
      "type": "blockchain_onramp_transfer"
    }
  ],
  "next_cursor": "v57w5d"
}
```

## Create a Blockchain On-Ramp Transfer
POST /blockchain_onramp_transfers

### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/blockchain_onramp_transfers" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d $'{
    "amount": 10000,
    "blockchain": "ethereum",
    "description": "Moving funds on-chain",
    "destination_blockchain_address": "0x304a554a310C7e546dfe434669C62820b7D83490",
    "source_account_id": "account_in71c4amph0vgo2qllky",
    "token": "usdc"
  }'
```

### Body Parameters
- `amount` (integer, required)
  The transfer amount in USD cents.

- `blockchain` (enum, required)
  The blockchain network.
  Cases:
  * `ethereum` (The Ethereum blockchain.)
  * `base` (The Base blockchain.)
  * `solana` (The Solana blockchain.)

- `description` (string, optional)
  A description you choose for the transfer.

- `destination_blockchain_address` (string, required)
  The blockchain address to send the funds to.

- `source_account_id` (string, required)
  The identifier of the Account from which to send the transfer.

- `token` (enum, required)
  The token to transfer.
  Cases:
  * `usdc` (A USD stablecoin issued by Circle.)

## Retrieve a Blockchain On-Ramp Transfer
GET /blockchain_onramp_transfers/{blockchain_onramp_transfer_id}

### Example
```curl
curl \
  --url "${INCREASE_URL}/blockchain_onramp_transfers/blockchain_onramp_transfer_sg8nzy569rk0dnfk28bv" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `blockchain_onramp_transfer_id` (string, required)
  The identifier of the Blockchain On-Ramp Transfer.

## Sandbox: Confirm a Blockchain On-Ramp Transfer
POST /simulations/blockchain_onramp_transfers/{blockchain_onramp_transfer_id}/confirm
> Simulates the confirmation of a [Blockchain On-Ramp Transfer](#blockchain-onramp-transfers) on the blockchain. This transfer must first have a `status` of `pending_review`, `pending_submission`, or `pending_confirmation`.
### Example
```curl
curl -X "POST" \
  --url "${INCREASE_URL}/simulations/blockchain_onramp_transfers/blockchain_onramp_transfer_sg8nzy569rk0dnfk28bv/confirm" \
  -H "Authorization: Bearer ${INCREASE_API_KEY}"
```
### Path Parameters
- `blockchain_onramp_transfer_id` (string, required)
  The identifier of the Blockchain On-Ramp Transfer you wish to confirm.