Skip to content
This repository was archived by the owner on Sep 3, 2026. It is now read-only.

Commit 68f4abb

Browse files
committed
feat(crypto-onramp): changeset
1 parent 5c2363f commit 68f4abb

2 files changed

Lines changed: 27 additions & 16 deletions

File tree

‎.changeset/crypto-onramp-metadata.md‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎.changeset/crypto-onramp.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
'@ton/walletkit': patch
3+
'@ton/appkit': patch
4+
'@ton/appkit-react': patch
5+
---
6+
7+
Add crypto-onramp support — bridging another chain's crypto into a TON-side asset (e.g. ETH on Arbitrum → USDT on TON) through pluggable providers.
8+
9+
**@ton/walletkit**
10+
11+
- `CryptoOnrampManager` — registers, switches and delegates to crypto-onramp providers with a unified API: `getQuote`, `createDeposit`, `getStatus`, `getSupportedCurrencies`, and synchronous `getMetadata`.
12+
- `CryptoOnrampProvider` abstract base + `CryptoOnrampProviderInterface` for custom providers.
13+
- Two built-in providers: **Layerswap** and **Decent** (formerly Swaps.xyz), each with configurable supported chains and currencies.
14+
- Models: `CryptoOnrampQuote`, `CryptoOnrampDeposit`, `CryptoOnrampStatus`, `CryptoOnrampSourceCurrency` / `CryptoOnrampDestinationCurrency`, `CryptoOnrampSupportedCurrencies`, and `CryptoOnrampProviderMetadata` (carries `refundAddressMode` — `off` / `optional` / `required` — and `isReversedAmountSupported`). CAIP-2 chain identifiers via `Caip2ByNetwork`.
15+
- Currency addresses are normalized to canonical sentinels — `'native'` for a source chain's native coin and `'ton'` for native Toncoin (surfaced as GRAM); each provider translates them to its own API form internally.
16+
- Errors surface as `CryptoOnrampError` / `CryptoOnrampErrorCode`.
17+
18+
**@ton/appkit**
19+
20+
- Actions: `getCryptoOnrampProvider`, `getCryptoOnrampProviders`, `watchCryptoOnrampProviders`, `setDefaultCryptoOnrampProvider`, `getCryptoOnrampQuote`, `createCryptoOnrampDeposit`, `getCryptoOnrampStatus`, `getCryptoOnrampSupportedCurrencies`, `getCryptoOnrampProviderMetadata`.
21+
- Matching TanStack Query helpers for quote, status and supported currencies, plus a deposit mutation.
22+
- Built-in providers ship as tree-shakeable subpath imports: `@ton/appkit/crypto-onramp/layerswap` (`createLayerswapProvider`) and `@ton/appkit/crypto-onramp/decent` (`createDecentProvider`).
23+
24+
**@ton/appkit-react**
25+
26+
- `CryptoOnrampWidget` — a drop-in buy flow, with the headless `CryptoOnrampWidgetProvider` / context for fully custom UIs. Covers token + payment-method selection with network filters, amount input (with reversed/target-amount entry where the provider supports it), live quote, deposit address + status polling, a refund-address modal driven by the provider's `refundAddressMode`, a provider settings modal, and empty/loading states.
27+
- Hooks: `useCryptoOnrampProviders`, `useCryptoOnrampProvider`, `useCryptoOnrampProviderById`, `useCryptoOnrampQuote`, `useCreateCryptoOnrampDeposit`, `useCryptoOnrampStatus`, `useCryptoOnrampSupportedCurrencies`, `useCryptoOnrampProviderMetadata`.

0 commit comments

Comments
 (0)