Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 41 additions & 18 deletions app-developers/guides/configuring-actions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Configuring Actions
title: Configuring Actions SDK
sidebar: Configuring Actions SDK
description: Learn how to configure Actions SDK for your application.
---

Expand Down Expand Up @@ -84,17 +85,16 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid

</Step>
<Step title="Configure supported assets">
Configure which assets you want to support:
Configure which assets you want to support across all lend providers:

```typescript title="actions.ts"
// Additional config from previous steps...

// Import popular assets
import { USDC } from '@eth-optimism/actions-sdk/assets'
import type { Asset, AssetsConfig } from "@eth-optimism/actions-sdk";

// Or define custom assets
import type { Asset } from "@eth-optimism/actions-sdk";

export const CustomToken: Asset = {
address: {
[mainnet.id]: '0x123...',
Expand All @@ -108,6 +108,12 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid
},
type: 'erc20',
}

// Configure allowed/blocked assets (both optional)
const assetsConfig: AssetsConfig = {
allow: [USDC, CustomToken], // Optional - defaults to all supported assets
block: [], // Optional
}
```

</Step>
Expand All @@ -127,37 +133,53 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid
```

</Step>
<Step title="Configure a Lend Provider">
Configure which lend protocol you want to support:
<Step title="Configure Lend Providers">
Configure which lend protocols you want to support. You can enable one or multiple providers:

<Tabs>
<Tab title="Morpho">
<Tab title="Morpho Only">
```typescript title="actions.ts"
// Additional config from previous steps...

import type { LendConfig } from "@eth-optimism/actions-sdk";

const lendConfig: LendConfig = {
morpho: {
marketAllowlist: [GauntletUSDC],
marketBlocklist: [], // Optional
},
};
```
</Tab>
<Tab title="Aave Only">
```typescript title="actions.ts"
// Additional config from previous steps...

import type { LendConfig } from "@eth-optimism/actions-sdk";

const lendConfig: LendConfig = {
type: "morpho",
assetAllowlist: [USDC, CustomToken],
assetBlocklist: [],
marketAllowlist: [GauntletUSDC],
marketBlocklist: [],
aave: {
marketAllowlist: [AaveWETH],
marketBlocklist: [], // Optional
},
};
```
</Tab>
<Tab title="Aave">
<Tab title="Both Morpho & Aave">
```typescript title="actions.ts"
// Additional config from previous steps...

import type { LendConfig } from "@eth-optimism/actions-sdk";

const lendConfig: LendConfig = {
type: "aave",
assetAllowlist: [USDC, CustomToken],
assetBlocklist: [],
marketAllowlist: [],
marketBlocklist: [],
morpho: {
marketAllowlist: [GauntletUSDC],
marketBlocklist: [],
},
aave: {
marketAllowlist: [AaveWETH],
marketBlocklist: [],
},
};
```
</Tab>
Expand Down Expand Up @@ -206,6 +228,7 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid
export const actions = createActions({
wallet: walletConfig,
lend: lendConfig,
assets: assetsConfig, // Optional
chains,
});
```
Expand Down