> ## Documentation Index
> Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK ramp events

> Reference for the lifecycle events the MoonPay off-ramp widget SDK sends to your parent app, and the methods to handle them.

## Interface: RampsChildToParentInterface

This interface represents the events that the Widget SDK can trigger from within the MoonPay Widget to partners' parent applications.

This allows partner apps to be informed and adapt to certain widget lifecycle events.

### Hierarchy

* `RampsSwapsKycChildToParentInterface`

  ↳ **`RampsChildToParentInterface`**

### Methods

#### `onAuthToken`

This event is only fired for those integrating with our Swaps (SDK+API) product.

`onAuthToken(props): Promise<void>`

Fired when the partner needs to receive an updated customer auth token so they can perform authorized actions on behalf of the customer.

**Parameters**

| Name    | Type                                                                                             |
| ------- | ------------------------------------------------------------------------------------------------ |
| `props` | [`OnAuthTokenProps`](/widget/on-ramp/integration-methods/sdks/event-properties#onauthtokenprops) |

**Returns**

`Promise<void>`

**Inherited from**

`RampsSwapsKycChildToParentInterface.onAuthToken`

#### `onClose`

`onClose(): Promise<void>`

Fired when the Widget is closing, triggered by either system logic or user actions.

**Returns**

`Promise<void>`

#### `onInitiateDeposit`

`onInitiateDeposit(props): Promise<OnInitiateDepositReplyProps>`

Called in the integrated sell flow, in the transaction tracker, when the widget is waiting for the sell amount to be deposited by the customer.

This allows the partner to trigger a deposit right from their wallet app.

**Parameters**

| Name    | Type                                                                                                         |
| ------- | ------------------------------------------------------------------------------------------------------------ |
| `props` | [`OnInitiateDepositProps`](/widget/on-ramp/integration-methods/sdks/event-properties#oninitiatedepositprops) |

**Returns**

`Promise`\<[`OnInitiateDepositReplyProps`](/widget/on-ramp/integration-methods/sdks/event-properties#oninitiatedepositreplyprops)>

#### `onLogin`

`onLogin(props): Promise<void>`

Fired when the customer logs in or their authentication is refreshed.

**Parameters**

| Name    | Type                                                                                     |
| ------- | ---------------------------------------------------------------------------------------- |
| `props` | [`OnLoginProps`](/widget/on-ramp/integration-methods/sdks/event-properties#onloginprops) |

**Returns**

`Promise<void>`

#### `onReady`

`onReady(): Promise<void>`

Fired when the SDK's communication layer has been set up and the Widget is loaded.

**Returns**

`Promise<void>`

#### `onSwapsCustomerSetupComplete`

`onSwapsCustomerSetupComplete(): Promise<void>`

Fired when the Swaps Customer Setup flow has completed signaling to the parent app that the widget may now be closed.

**Returns**

`Promise<void>`

**Inherited from**

`RampsSwapsKycChildToParentInterface.onSwapsCustomerSetupComplete`

#### `onTransactionCreated`

`onTransactionCreated**(props): Promise<void>`

Fired when a buy or sell transaction is created, just before redirecting to the transaction tracker.

**Parameters**

| Name    | Type                                                                                                               |
| ------- | ------------------------------------------------------------------------------------------------------------------ |
| `props` | [`OnTransactionCreatedProps`](/widget/on-ramp/integration-methods/sdks/event-properties#ontransactioncreatedprops) |

**Returns**

`Promise<void>`

#### `onTransactionCompleted`

`onTransactionCompleted(props): Promise<void>`

Fired when a transaction is detected as completed or if a previously completed transaction is loaded again in the transaction tracker.

**Parameters**

| Name    | Type                                                                                                                   |
| ------- | ---------------------------------------------------------------------------------------------------------------------- |
| `props` | [`OnTransactionCompletedProps`](/widget/on-ramp/integration-methods/sdks/event-properties#ontransactioncompletedprops) |

**Returns**

`Promise<void>`

#### `onUnsupportedRegion`

`onUnsupportedRegion(): Promise<void>`

Fired when the Unsupported Region screen is triggered, independently of whether the widget redirects away from it.

**Returns**

`Promise<void>`
