bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 53쪽
ddress_id": "'"${USDC_DESTINATION_ADDRESS_ID}"'",
"value_type": "USDC",
"transfer_type": "base"
}
}'
```
***
## Offramps: Stablecoin to Fiat
Convert your stablecoin back to USD via wire or ACH.
### Offramp to Wire
```bash theme={null}
export USD_DESTINATION_ADDRESS_ID="your_wire_destination_address_id"
curl --request POST \
--url "https://api.brale.xyz/accounts/${ACCOUNT_ID}/transfers" \
--header "Authorization: Bearer ${AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: $(uuidgen)" \
--data '{
"amount": {
"value": "1000.00",
"currency": "USD"
},
"source": {
"address_id": "'"${MONAD_ADDRESS_ID}"'",
"value_type": "'"${TOKEN_SYMBOL}"'",
"transfer_type": "'"${MONAD_TRANSFER_TYPE}"'"
},
"destination": {
"address_id": "'"${USD_DESTINATION_ADDRESS_ID}"'",
"value_type": "usd",
"transfer_type": "wire"
}
}'
```
### Offramp to ACH
For ACH payouts, use `ach_credit` or `same_day_ach_credit` on the destination address instead of `wire`.
***
## Monitoring Transfers
Check transfer status by querying the transfer ID:
```bash theme={null}
export TRANSFER_ID="your_transfer_id"
curl --request GET \
--url "https://api.brale.xyz/accounts/${ACCOUNT_ID}/transfers/${TRANSFER_ID}" \
--header "Authorization: Bearer ${AUTH_TOKEN}"
```
### Transfer States
| Status | Description |
| - | - |
| `pending` | Transfer submitted but not yet in progress |
| `processing` | Transfer is in progress |
| `complete` | Transfer finalized and funds have arrived at the destination |
| `canceled` | Transfer has been canceled |
| `failed` | Transfer could not be completed |
***
## Best Practices
### Security
* Store API credentials in environment variables or a secrets manager
* Use a fresh idempotency key for each new transfer request
* Refresh bearer tokens when they expire
### Testing
* Use testnet credentials during development
* Use `monad_testnet` while testing and `monad` in production
* Do not mix testnet credentials/resources with mainnet flows
### Addressing
* Use internal addresses for Brale-custodied wallets
* Register self-custody Monad wallets as external addresses before using them in transfers
* Store returned `address_id` values and reuse them across workflows
***
## Next Steps
* Explore the [Brale docs](https://docs.brale.xyz/)
* Review the [Brale API MCP guide](https://docs.brale.xyz/mcp/api)
* Confirm [supported transfer types and value types](https://docs.brale.xyz/coverage/transfer-types) before shipping production flows
# How to make your Monad contract clear-signable (ERC-7730)
Source: https://docs.monad.xyz/guides/clear-signing
ERC-7730 descriptors tell wallets how to display your contract calls and typed-data signatures in plain language. For Monad, the process is the same as any EVM chain: write the descriptor, bind it to `chainId` 143 and your contract address, then add it to the public registry.
## What is clear signing?
[ERC-7730](https://eips.ethereum.org/EIPS/eip-7730) is a JSON format for describing how a wallet should render contract calldata and EIP-712 messages. The descriptor lives outside your contract. It maps functions, message types, and fields to labels and formatters a wallet can show before a user signs.
The lookup key is `chainId` plus contract address, so Monad contracts do not need a Monad-specific version of the standard.
Without a descriptor, a wallet may only have raw calldata:
```text theme={null}
0x095ea7b3000000000000000000000000fe9c9ca3eed0fb3e6a5c0bf42ad6f1a0d1c7b2a40000000000000000000000000000000000000000000000000000000003b9aca00
```
With a descriptor, the same approval can be shown as fields a user can check:
```text theme={null}
Approve USDC
Spender: Uniswap V3 Router
Amount: 1,000 USDC
Network: Monad
```
## Why it matters for Monad
Users should not have to trust the site that assembled a transaction. A spoofed frontend can ask for one action while submitting another, and raw calldata gives most users nothing useful to inspect. Clear signing moves the important details into the wallet prompt: the action, recipient, amount, token, deadline, or any other field that matters for the call.
Adding a descriptor does not require a contract change. You publish a JSON file, validate it, and submit it to the registry used by wallets that support ERC-7730.
> Monad mainnet `chainId` is `143` (testnet `10143`). See [Network Information](/developer-essentials/network-information).
## Quickstart
Install [`uv`](https://docs.astral.sh/uv/) first. The `uvx` command runs the `erc7730` tool without a separate global install.
1. Generate a starting descriptor from your ABI:
```bash theme={null}
uvx erc7730 generate \
--chain-id 143 \
--address 0xYourContractOnMonad \
--abi ./abi/YourContract.json \
--owner "Your Protocol" \
--url "https://yourprotocol.xyz" \
> calldata-yourcontract.json
```
2. Edit the intents and field labels so they read like English (see [Editing the descriptor](#editing-the-descriptor)).
3. Validate the descriptor:
```bash theme={null}
uvx erc7730 lint calldata-yourcontract.json
```
4. Preview how a wallet renders your fields at [clear-signing.sourcify.dev](https://clear-signing.sourcify.dev).
5. Open a PR to the [ERC-7730 registry](https://github.com/ethereum/clear-signing-erc7730-registry). CI validates it against the schema, a maintainer reviews, and once merged, supporting wallets can use it.
Open the PR from an account tied to the protocol or contract owner. Registry maintainers may ask for proof that you control the deployment.
## Keep the ABI inline
The `generate` command embeds your contract ABI under `context.contract.abi`, which makes the descriptor self-contained. Leave it there: with the ABI in the file, the fields validate locally and nothing has to reach an explorer to make sense of the call.
While linting you may see a warning like this:
```text theme={null}
warning: Could not fetch ABI: Fetching reference ABI for chain id 143 failed, display fields will not be validated against ABI: ... Missing/Invalid API Key
```
The warning is harmless. On top of your inline ABI, `erc7730` also tries to fetch the deployed contract's ABI from Etherscan to cross-check your display fields, and that request needs an `ETHERSCAN_API_KEY`. Set one (`export ETHERSCAN_API_KEY=...`) and lint passes clean; without it, that cross-check is skipped. Either way, keep the inline `abi`.
```json theme={null}
{
"context": {
"contract": {
"deployments": [
{ "chainId": 143, "address": "0xYourContractOnMonad" }
],
"abi": [
{
"type": "function",
"name": "approve",
"inputs": [
{ "name": "spender", "type": "address" },
{ "name": "amount", "type": "uint256" }
]
}
]
}
}
}
```
## Editing the descriptor
`generate` gives you a skeleton with one entry per function. Most of the hand-editing is in two places:
* **`intent`**: a short action label, such as `Approve USDC` or `Wrap MON`. Keep it to 30 characters or fewer; some hardware wallet screens truncate longer strings.
* **`fields`**: the parameters you want users to review, each with a `label` and `format`.
Use the most specific formatter that fits the value:
| `format` | Renders | Notes |
| - | - | - |
| `tokenAmount` | `1,000 USDC` | Applies decimals and ticker. Set a `threshold` with a `message` like `Unlimited` for max approvals. |
| `amount` | Native MON with ticker | Reads the transaction `value`. |
| `addressName` | A known name, otherwise a checksummed address | Use `types` (eoa, contract, token) and `sources` (local, ens). |
| `raw` | A number, string, or address as-is | |
| `date` | A readable date from a unix timestamp | Set `encoding`. |
Field paths use three roots: `#.` for decoded calldata or message fields, `$.` for this descriptor's own metadata, and `@.` for the transaction container, such as `@.value`.
## Monad examples
These Monad descriptors are useful references when writing your own:
<ul>
<li>
<strong>Permit2</strong>, the EIP-712 approval contract used across many dApps, at <CopyToClipboard>[`0x000000000022D473030F116dDEE9F6B43aC78BA3`](https://monadvision.com/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)</CopyToClipboard>, added to the canonical Uniswap descriptor in [registry PR #2611](https://github.com/ethereum/clear-signing-erc7730-registry/pull/2611).
</li>
<li>
<strong>The Monad staking precompile</strong> (delegate, undelegate, claim rewards) at <CopyToClipboard>[`0x0000000000000000000000000000000000001000`](https://monadvision.com/address/0x0000000000000000000000000000000000001000)</CopyToClipboard>, in [registry PR #2589](https://github.com/ethereum/clear-signing-erc7730-registry/pull/2589).
</li>
<li>
<strong>Wrapped MON</strong> (wrap, unwrap, and ERC-20 calls) at <CopyToClipboard>[`0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A`](https://monadvision.com/address/0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A)</CopyToClipboard>.
</li>
</ul>
## How a wallet uses the descriptor
At a high level, a supporting wallet does this:
1. A user starts a transaction or signs an EIP-712 message.
2. The wallet computes the 4-byte selector (or the EIP-712 type hash).
3. It looks up the descriptor by `chainId` and address.
4. It checks that the descriptor's `context` binding matches the actual target.
5. It decodes the parameters with the ABI and resolves token and name metadata.
6. It applies each field formatter and shows the `intent` with the formatted fields.
If no descriptor is found, the wallet falls back to its default signing view.
## Resources
* [ERC-7730 specification](https://eips.ethereum.org/EIPS/eip-7730)
* [ERC-7730 registry](https://github.com/ethereum/clear-signing-erc7730-registry)
* [Sourcify preview tool](https://clear-signing.sourcify.dev)
* [clearsigning.org](https://clearsigning.org)
* [Network Information (chainId 143)](/developer-essentials/network-information)
* [Monad Developer Discord](https://discord.gg/monaddev)
# How to build custom deep links in an Expo-based mobile app
Source: https://docs.monad.xyz/guides/deeplinks-using-expo
Deep links are URLs that take users directly to specific content within a mobile app or website, rather than just launching the app's home screen. They work like shortcuts, enabling smoother navigation and improving user experience.
In this guide, you will learn the basics of adding deep links into your [Expo](https://docs.expo.dev/)-based mobile app.
## What are deep links?
Deep link is constructed by three parts:
* **Scheme**: The URL scheme that identifies the app that should open the URL (example: myapp\://). It can also be https or http for non-standard deep links.
* **Host**: The domain name of the app that should open the URL (example: web-app.com).
* **Path**: The path to the screen that should be opened (example: /product). If the path isn't specified, the user is taken to the home screen of the app.
Deep links can also have params just like web links!
Example:
```
rnwalletapp://swap?from={token}&to={token}&amount={amount}
```
## Building a deep link
<Note>
If you'd like to try a deep link demo you can do by cloning [this](https://github.com/monad-developers/expo-swap-template/tree/branch/deeplink?tab=readme-ov-file) repo and switching to the `branch/deeplink` branch:
```bash theme={null}
git clone https://github.com/monad-developers/expo-swap-template.git
```
```bash theme={null}
git checkout branch/deeplink
```
</Note>
### Defining the scheme
The first step is to define a scheme; you can do so by editing the `app.json` file in the Expo project.
```json title="app.json" theme={null}
{
"expo": {
"scheme": "myapp" // or your preferred scheme
}
}
```
<Warning>
Custom schemes like `myapp://` are not unique across Android or iOS.
If two apps register the same scheme, the system won’t know which one to launch, or it might launch the wrong one.
Use something app-specific and hard to accidentally duplicate.
</Warning>
### Listening for deep link events
In your app entrypoint (e.g., `_layout.tsx` or a provider), add logic to:
* Handle initial deep link
* Listen for deep link changes
A good practice is to create a `DeepLinkHandler` and wrap the entire app with it.
Example (in an Expo project using File-based routing):
```tsx lines title="app/_layout.tsx" theme={null}
...
// Function to parse the deep link and get the hostname and queryParams
function parseSwapDeeplink(url: string): SwapDeeplinkParams | null {
try {
const { hostname, queryParams } = Linking.parse(url);
if (hostname !== 'swap' || !queryParams) {
return null;
}
return {
from: queryParams.from as string | undefined,
to: queryParams.to as string | undefined,
amount: queryParams.amount as string | undefined,
};
} catch (error) {
console.error('Error parsing deeplink:', error);
return null;
}
}
function DeeplinkHandler({ children }: { children: React.ReactNode }) {
const router = useRouter();
useEffect(() => {
const handleDeeplink = (url: string) => {
// Parse the deep link and get the params (host, path, params etc...)
const params = parseSwapDeeplink(url);
if (params) {
// The example here makes the params globally accessible in the app, however you can use React Context or similar to make the params accessible from anywhere in the app.
(global as any).swapDeeplinkParams = params;
// Based on the path or host you can redirect the user to the respective screen in the app
router.replace('/');
}
};
// Handle initial URL
Linking.getInitialURL().then(url => url && handleDeeplink(url));
// Create an event listener and handle URL changes while app is open
const subscription = Linking.addEventListener('url', event => handleDeeplink(event.url));
// Removes the event listener when the component is destroyed (avoids memory leaks)
return () => subscription.remove();
}, [router]);
return <>{children}</>;
}
export default function Layout() {
...
return (
<DeeplinkHandler>
<App />
</DeeplinkHandler>
);
}
```
That's it, your app is ready to handle deep links based on the `hostname` and `queryParams` you can redirect the user to the respective screens.
Additionally if you make the `queryParams` accessible globally (via context or some other way) you can prefill input values too!
**Example: Prefilling token swap amounts!**
## Testing the deep link
Here's a demo of how deep links work in a mobile app:
<iframe title="YouTube video player" />
### Testing on iOS simulator
```bash theme={null}
xcrun simctl openurl booted [deeplink]
```
Example:
```bash theme={null}
xcrun simctl openurl booted "rnwalletapp://swap?from=MON&to=USDC&amount=100"
```
### Testing on Android emulator
```bash theme={null}
adb shell am start -W -a android.intent.action.VIEW -d [deeplink]
```
Example:
```bash theme={null}
# Important: Use single quotes to wrap the entire command to prevent shell from parsing & symbols
adb shell 'am start -W -a android.intent.action.VIEW -d "rnwalletapp://swap?from=MON&to=USDC&amount=100"'
```
<Warning>
If you don't use single quotes, the shell will interpret `&` as a command separator, and only the first parameter will be passed to the app.
</Warning>
### Testing on a physical device
You can create a simple HTML page with links.
Example:
```html theme={null}
<a href="rnwalletapp://swap?from=MON&to=USDC&amount=100">Swap MON to USDC</a>
```
## Try out the demo
If you'd like to try a deep link demo you can do by setting up [this](https://github.com/monad-developers/expo-swap-template/tree/branch/deeplink?tab=readme-ov-file) repo and switch to the `branch/deeplink` branch.
```bash theme={null}
git clone https://github.com/monad-developers/expo-swap-template.git
```
```bash theme={null}
git checkout branch/deeplink
```
Here are some deep links you can try:
1. Swap MON to USDC
```
rnwalletapp://swap?from=MON&to=USDC
```
2. Swap 100 MON to USDC
```
rnwalletapp://swap?from=MON&to=USDC&amount=100
```
3. Swap USDC to WMON
```
rnwalletapp://swap?from=USDC&to=WMON&amount=1000
```
# How to build with ERC-6551 (Token-Bound Accounts) on Monad
Source: https://docs.monad.xyz/guides/erc-6551
Give every NFT its own smart-contract wallet on Monad using the canonical Tokenbound ERC-6551 deployment.
This guide shows how to give any NFT its own account (wallet) on Monad using the canonical [Tokenbound](https://tokenbound.org) ERC-6551 v3 deployment. The full stack is live on both Monad mainnet and testnet at the same canonical addresses used on Ethereum and Base, so the standard `@tokenbound/sdk` works with no custom contract configuration.
## What is ERC-6551?
[ERC-6551](https://eips.ethereum.org/EIPS/eip-6551) gives every ERC-721 NFT its own smart-contract account — a "token-bound account" (TBA). The account is owned by whoever currently holds the NFT, so anything the account owns or can do transfers automatically when the NFT is transferred.
Concretely, a token-bound account can:
* Hold assets — ERC-20s, other NFTs, and native MON.
* Execute arbitrary transactions, authorized by the current NFT holder.
* Act as an identity or inventory for games, agents, memberships, and loyalty programs.
Because accounts are created deterministically through a shared, permissionless registry, the account address for a given NFT is knowable in advance and identical across every chain the standard is deployed on.
### Key benefits
* **Ownership follows the NFT**: transfer the NFT and its entire account — assets and permissions — moves with it, atomically, with no migration step.
* **Deterministic addresses**: an NFT's account address is computed from `(chainId, tokenContract, tokenId, implementation, salt)`, so it can be derived off-chain before the account is even deployed.
* **No new standard to learn on the wallet side**: a TBA is a smart account, compatible with existing tooling and ERC-4337 account abstraction.
* **Works out of the box**: Monad uses the canonical Tokenbound contracts at their standard cross-chain addresses, so existing ERC-6551 apps and the Tokenbound SDK point at Monad with a config change only.
## Canonical deployment on Monad
The Tokenbound ERC-6551 v3 stack is deployed at its canonical, deterministic addresses on **Monad mainnet (chain ID 143)** and **Monad testnet (chain ID 10143)**. The addresses are identical on both networks and match the Ethereum/Base deployments. All contracts are source-verified on [Monadscan](https://monadscan.com) and [MonadVision](https://monadvision.com).
<ul>
<li>
<strong>ERC-6551 Registry</strong>:
<CopyToClipboard>
`0x000000006551c19487814612e58FE06813775758`
</CopyToClipboard>
<span>
(
<a href="https://monadscan.com/address/0x000000006551c19487814612e58FE06813775758">mainnet</a>
<a href="https://testnet.monadscan.com/address/0x000000006551c19487814612e58FE06813775758">testnet</a>
)
</span>
</li>
<li>
<strong>V3 Account Implementation</strong>:
<CopyToClipboard>
`0x41C8f39463A868d3A88af00cd0fe7102F30E44eC`
</CopyToClipboard>
<span>
(
<a href="https://monadscan.com/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC">mainnet</a>
<a href="https://testnet.monadscan.com/address/0x41C8f39463A868d3A88af00cd0fe7102F30E44eC">testnet</a>
)
</span>
</li>
<li>
<strong>V3 Account Proxy</strong>:
<CopyToClipboard>
`0x55266d75D1a14E4572138116aF39863Ed6596E7F`
</CopyToClipboard>
<span>
(
<a href="https://monadscan.com/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F">mainnet</a>
<a href="https://testnet.monadscan.com/address/0x55266d75D1a14E4572138116aF39863Ed6596E7F">testnet</a>
)
</span>
</li>
<li>
<strong>V3 Account Guardian</strong>:
<CopyToClipboard>
`0x2fe5CCB0d7Ea195FEB87987D3573f9FccE2b5d57`
</CopyToClipboard>
<span>
(
<a href="https://monadscan.com/address/0x2fe5CCB0d7Ea195FEB87987D3573f9FccE2b5d57">mainnet</a>
<a href="https://testnet.monadscan.com/address/0x2fe5CCB0d7Ea195FEB87987D3573f9FccE2b5d57">testnet</a>
)
</span>
</li>
<li>
<strong>Authenticated Multicall (Forwarder)</strong>:
<CopyToC프로젝트로 돌아가기