@usdctofiat/offramp 1.0.1 → 1.1.1
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 +38 -10
- package/dist/{chunk-2UENKRGX.js → chunk-2XJXFOPJ.js} +784 -125
- package/dist/chunk-2XJXFOPJ.js.map +1 -0
- package/dist/{errors-A8NBr_Iw.d.cts → errors-Dtzrl98J.d.cts} +5 -1
- package/dist/{errors-A8NBr_Iw.d.ts → errors-Dtzrl98J.d.ts} +5 -1
- package/dist/index.cjs +714 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +688 -46
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +5 -2
- package/dist/react.js.map +1 -1
- package/package.json +30 -13
- package/dist/chunk-2UENKRGX.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@usdctofiat/offramp)
|
|
4
4
|
[](https://github.com/ADWilkinson/galleonlabs-zkp2p/blob/main/packages/offramp-sdk/LICENSE)
|
|
5
5
|
|
|
6
|
-
USDC-to-fiat offramp SDK for Base.
|
|
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
|
|
68
|
-
PLATFORMS.REVOLUT.currencies
|
|
69
|
-
PLATFORMS.REVOLUT.identifier.label
|
|
70
|
-
PLATFORMS.REVOLUT.identifier.placeholder // "revtag (no @)"
|
|
71
|
-
PLATFORMS.REVOLUT.identifier.help
|
|
72
|
-
PLATFORMS.REVOLUT.validate("@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
|
|
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
|