@usdctofiat/offramp 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@usdctofiat/offramp?color=8fb47d)](https://www.npmjs.com/package/@usdctofiat/offramp)
4
4
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ADWilkinson/galleonlabs-zkp2p/blob/main/packages/offramp-sdk/LICENSE)
5
5
 
6
- USDC-to-fiat offramp SDK for Base. 3 functions + 2 const objects.
6
+ USDC-to-fiat offramp SDK for Base. 6 functions + 2 const objects.
7
7
 
8
8
  ## Install
9
9
 
@@ -64,16 +64,44 @@ function SellButton({ walletClient }: { walletClient: WalletClient }) {
64
64
  ```typescript
65
65
  import { PLATFORMS, CURRENCIES } from "@usdctofiat/offramp";
66
66
 
67
- PLATFORMS.REVOLUT.name // "Revolut"
68
- PLATFORMS.REVOLUT.currencies // ["USD", "EUR", "GBP", ...]
69
- PLATFORMS.REVOLUT.identifier.label // "Revtag"
70
- PLATFORMS.REVOLUT.identifier.placeholder // "revtag (no @)"
71
- PLATFORMS.REVOLUT.identifier.help // "Revtag without @ (must be public)"
72
- PLATFORMS.REVOLUT.validate("@alice") // { valid: true, normalized: "alice" }
67
+ PLATFORMS.REVOLUT.name; // "Revolut"
68
+ PLATFORMS.REVOLUT.currencies; // ["USD", "EUR", "GBP", ...]
69
+ PLATFORMS.REVOLUT.identifier.label; // "Revtag"
70
+ PLATFORMS.REVOLUT.identifier.placeholder; // "revtag (no @)"
71
+ PLATFORMS.REVOLUT.identifier.help; // "Revtag without @ (must be public)"
72
+ PLATFORMS.REVOLUT.validate("@alice"); // { valid: true, normalized: "alice" }
73
73
 
74
- CURRENCIES.EUR.symbol // "€"
75
- CURRENCIES.EUR.name // "Euro"
76
- CURRENCIES.EUR.countryCode // "eu"
74
+ CURRENCIES.EUR.symbol; // "€"
75
+ CURRENCIES.EUR.name; // "Euro"
76
+ CURRENCIES.EUR.countryCode; // "eu"
77
+ ```
78
+
79
+ ## OTC Private Orders
80
+
81
+ Restrict a deposit to a single taker wallet. Pass `otcTaker` and the deposit is created, delegated, and restricted in one call:
82
+
83
+ ```typescript
84
+ import { offramp, PLATFORMS, CURRENCIES } from "@usdctofiat/offramp";
85
+
86
+ const { depositId, otcLink } = await offramp(walletClient, {
87
+ amount: "100",
88
+ platform: PLATFORMS.REVOLUT,
89
+ currency: CURRENCIES.EUR,
90
+ identifier: "alice",
91
+ otcTaker: "0xBuyerAddress",
92
+ });
93
+ // otcLink = "https://usdctofiat.xyz/deposit/0x.../362"
94
+ // Share otcLink with the buyer — they open it, connect their wallet, and fill the order.
95
+ ```
96
+
97
+ Toggle OTC on existing deposits:
98
+
99
+ ```typescript
100
+ import { enableOtc, disableOtc, getOtcLink } from "@usdctofiat/offramp";
101
+
102
+ await enableOtc(walletClient, "362", "0xBuyerAddress");
103
+ await disableOtc(walletClient, "362"); // make public again
104
+ getOtcLink("362"); // just the URL, no tx
77
105
  ```
78
106
 
79
107
  ## Resumable