@rhinestone/deposit-modal 0.19.0 → 0.20.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.
Files changed (83) hide show
  1. package/README.md +154 -61
  2. package/dist/BankOnrampStep-3SNUX6V2.cjs +435 -0
  3. package/dist/BankOnrampStep-4D24HVHV.mjs +435 -0
  4. package/dist/{DepositModalReown-UITYXJ6W.cjs → DepositModalReown-7EHOJTFW.cjs} +21 -20
  5. package/dist/{DepositModalReown-XBNY6QCI.mjs → DepositModalReown-SYQ2SCHC.mjs} +6 -5
  6. package/dist/WithdrawModal-LLJLEYXZ.cjs +12 -0
  7. package/dist/WithdrawModal-LXDIT4UV.mjs +12 -0
  8. package/dist/{bearer-transport-CVHNBgoV.d.cts → bearer-transport-DZyeDG64.d.cts} +5 -1
  9. package/dist/{bearer-transport-CVHNBgoV.d.ts → bearer-transport-DZyeDG64.d.ts} +5 -1
  10. package/dist/{caip-BMi-9t09.d.cts → caip-nwFFL46o.d.cts} +2 -2
  11. package/dist/{caip-BMi-9t09.d.ts → caip-nwFFL46o.d.ts} +2 -2
  12. package/dist/{chunk-FTWKAJGN.mjs → chunk-2FOPO4N5.mjs} +1 -1
  13. package/dist/{chunk-EG4H7OMC.cjs → chunk-CIVFT5KR.cjs} +171 -130
  14. package/dist/{chunk-PYOC6K24.cjs → chunk-D3R3O4CY.cjs} +1 -1
  15. package/dist/chunk-E7IMWVMN.mjs +346 -0
  16. package/dist/chunk-EJDBIWNH.mjs +113 -0
  17. package/dist/chunk-FKJ6EJHH.cjs +346 -0
  18. package/dist/{chunk-LVCD6RHF.cjs → chunk-FVJKUTHF.cjs} +2 -2
  19. package/dist/{chunk-NITKDXHR.mjs → chunk-FW7ZMXQS.mjs} +849 -674
  20. package/dist/chunk-G264OM23.cjs +224 -0
  21. package/dist/chunk-IPHKBBUV.cjs +113 -0
  22. package/dist/{chunk-BIL4ENC3.mjs → chunk-IPKT3FU6.mjs} +73 -32
  23. package/dist/chunk-JPX4MEHV.mjs +19 -0
  24. package/dist/{chunk-HMUGY66O.cjs → chunk-KXSU24RU.cjs} +1569 -1019
  25. package/dist/{chunk-ISLVD5HQ.cjs → chunk-LVMNNMOZ.cjs} +10 -5
  26. package/dist/chunk-O5OW4S7L.cjs +19 -0
  27. package/dist/{chunk-5NWLS5BQ.mjs → chunk-OZPMRTW3.mjs} +1511 -961
  28. package/dist/{chunk-OCWSMLOP.cjs → chunk-PVFEZ3UG.cjs} +1164 -989
  29. package/dist/{chunk-ZGHVJ2XM.mjs → chunk-YQCRXJIL.mjs} +8 -3
  30. package/dist/chunk-YY4ZOAH5.mjs +224 -0
  31. package/dist/{chunk-X6N2XPTO.mjs → chunk-ZOJMB5TZ.mjs} +1 -1
  32. package/dist/compliance.cjs +4 -7
  33. package/dist/compliance.d.cts +26 -3
  34. package/dist/compliance.d.ts +26 -3
  35. package/dist/compliance.mjs +6 -9
  36. package/dist/constants-BQDxVNgr.d.cts +29 -0
  37. package/dist/constants-DjGQW5N5.d.ts +29 -0
  38. package/dist/constants.cjs +3 -37
  39. package/dist/constants.d.cts +4 -20
  40. package/dist/constants.d.ts +4 -20
  41. package/dist/constants.mjs +4 -38
  42. package/dist/deposit.cjs +7 -6
  43. package/dist/deposit.d.cts +5 -3
  44. package/dist/deposit.d.ts +5 -3
  45. package/dist/deposit.mjs +6 -5
  46. package/dist/embed.cjs +21 -20
  47. package/dist/embed.d.cts +3 -2
  48. package/dist/embed.d.ts +3 -2
  49. package/dist/embed.mjs +7 -6
  50. package/dist/index.cjs +8 -35
  51. package/dist/index.d.cts +5 -3
  52. package/dist/index.d.ts +5 -3
  53. package/dist/index.mjs +9 -36
  54. package/dist/onramp.cjs +4 -33
  55. package/dist/onramp.d.cts +51 -33
  56. package/dist/onramp.d.ts +51 -33
  57. package/dist/onramp.mjs +5 -34
  58. package/dist/polymarket.cjs +6 -6
  59. package/dist/polymarket.mjs +2 -2
  60. package/dist/ramp-types-HYWd7CW0.d.cts +108 -0
  61. package/dist/ramp-types-HYWd7CW0.d.ts +108 -0
  62. package/dist/styles.css +255 -0
  63. package/dist/{types-BOxa1DE-.d.ts → types-BEEMfNi2.d.cts} +24 -4
  64. package/dist/{types-BShYNpvO.d.cts → types-DQDUqzsZ.d.ts} +24 -4
  65. package/dist/withdraw.cjs +6 -5
  66. package/dist/withdraw.d.cts +4 -3
  67. package/dist/withdraw.d.ts +4 -3
  68. package/dist/withdraw.mjs +5 -4
  69. package/package.json +9 -17
  70. package/dist/WithdrawModal-DY6A55OA.mjs +0 -11
  71. package/dist/WithdrawModal-V42OK7L3.cjs +0 -11
  72. package/dist/chunk-ADEWTBSN.cjs +0 -19
  73. package/dist/chunk-EAGMY3QE.mjs +0 -962
  74. package/dist/chunk-OY5N3E6L.cjs +0 -962
  75. package/dist/chunk-PP4QE32S.mjs +0 -19
  76. package/dist/constants-BT4ctuHo.d.cts +0 -64
  77. package/dist/constants-D21ZdNOP.d.ts +0 -64
  78. package/dist/offramp.cjs +0 -25
  79. package/dist/offramp.d.cts +0 -28
  80. package/dist/offramp.d.ts +0 -28
  81. package/dist/offramp.mjs +0 -25
  82. package/dist/ramp-types-C6aUz4SZ.d.cts +0 -43
  83. package/dist/ramp-types-C6aUz4SZ.d.ts +0 -43
@@ -0,0 +1,224 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/components/ui/Icons.tsx
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+ var _lucidereact = require('lucide-react');
23
+ var _jsxruntime = require('react/jsx-runtime');
24
+ var WalletIcon = _lucidereact.Wallet;
25
+ var ExternalLinkIcon = _lucidereact.ExternalLink;
26
+ var CheckIcon = _lucidereact.Check;
27
+ function TransferCryptoIcon() {
28
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
29
+ "svg",
30
+ {
31
+ width: "24",
32
+ height: "24",
33
+ viewBox: "8 8 24 24",
34
+ fill: "none",
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ "aria-hidden": "true",
37
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
38
+ "path",
39
+ {
40
+ d: "M26.08 18.37C27.03 18.72 27.87 19.30 28.53 20.07C29.19 20.83 29.65 21.75 29.86 22.73C30.07 23.72 30.03 24.74 29.74 25.71C29.45 26.68 28.92 27.55 28.20 28.26C27.48 28.97 26.59 29.49 25.62 29.76C24.65 30.04 23.63 30.06 22.64 29.83C21.66 29.61 20.75 29.14 20.00 28.47C19.24 27.80 18.67 26.95 18.33 26.00M15 14H16V18M24.70 21.87L25.40 22.58L22.58 25.40M22 16C22 19.31 19.31 22 16 22C12.68 22 10 19.31 10 16C10 12.68 12.68 10 16 10C19.31 10 22 12.68 22 16Z",
41
+ stroke: "currentColor",
42
+ strokeWidth: "2",
43
+ strokeLinecap: "round",
44
+ strokeLinejoin: "round"
45
+ }
46
+ )
47
+ }
48
+ );
49
+ }
50
+ var ChevronRightIcon = _lucidereact.ChevronRight;
51
+ var ChevronLeftIcon = _lucidereact.ChevronLeft;
52
+ var ChevronDownIcon = _lucidereact.ChevronDown;
53
+ var CloseIcon = _lucidereact.X;
54
+ var HandCoinsIcon = _lucidereact.HandCoins;
55
+ var CoinsIcon = _lucidereact.Coins;
56
+ var HistoryIcon = _lucidereact.History;
57
+ var InfoIcon = _lucidereact.Info;
58
+ var CopyIcon = _lucidereact.Copy;
59
+ var ArrowUpRightIcon = _lucidereact.ArrowUpRight;
60
+ var AlertTriangleIcon = _lucidereact.AlertTriangle;
61
+ var CircleArrowOutUpLeftIcon = _lucidereact.CircleArrowOutUpLeft;
62
+ var CardIcon = _lucidereact.CreditCard;
63
+ var BankIcon = _lucidereact.Landmark;
64
+ var UnplugIcon = _lucidereact.Unplug;
65
+ function MigrateAssetsIcon() {
66
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
67
+ "svg",
68
+ {
69
+ width: "24",
70
+ height: "24",
71
+ viewBox: "0 0 24 24",
72
+ fill: "none",
73
+ xmlns: "http://www.w3.org/2000/svg",
74
+ "aria-hidden": "true",
75
+ children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
76
+ "g",
77
+ {
78
+ stroke: "currentColor",
79
+ strokeWidth: "2",
80
+ strokeLinecap: "round",
81
+ strokeLinejoin: "round",
82
+ children: [
83
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
84
+ "path",
85
+ {
86
+ d: "M19 4.344V3C19 2.46957 18.7893 1.96086 18.4142 1.58579C18.0391 1.21071 17.5304 1 17 1H3C2.46957 1 1.96086 1.21071 1.58579 1.58579C1.21071 1.96086 1 2.46957 1 3V17C1 17.5304 1.21071 18.0391 1.58579 18.4142C1.96086 18.7893 2.46957 19 3 19H17C17.5304 19 18.0391 18.7893 18.4142 18.4142C18.7893 18.0391 19 17.5304 19 17V15.656",
87
+ transform: "translate(2 2)"
88
+ }
89
+ ),
90
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M1 1H12", transform: "translate(9 11)" }),
91
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M1 9L5 5L1 1", transform: "translate(16 7)" })
92
+ ]
93
+ }
94
+ )
95
+ }
96
+ );
97
+ }
98
+ function AppleIcon() {
99
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
100
+ "svg",
101
+ {
102
+ width: "24",
103
+ height: "24",
104
+ viewBox: "0 0 24 24",
105
+ fill: "none",
106
+ xmlns: "http://www.w3.org/2000/svg",
107
+ "aria-hidden": "true",
108
+ children: [
109
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
110
+ "path",
111
+ {
112
+ d: "M16.36 1.43c0 1.14-.49 2.27-1.18 3.08-.74.9-1.99 1.57-2.98 1.57-.12 0-.23-.02-.3-.03-.01-.06-.04-.22-.04-.39 0-1.15.57-2.27 1.2-2.98.8-.94 2.15-1.64 3.25-1.68.03.13.05.28.05.43z",
113
+ stroke: "currentColor",
114
+ strokeWidth: "1.6",
115
+ strokeLinejoin: "round"
116
+ }
117
+ ),
118
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
119
+ "path",
120
+ {
121
+ d: "M20.93 17.14c-.03.07-.46 1.58-1.52 3.12-.94 1.34-1.94 2.71-3.43 2.71-1.51 0-1.9-.88-3.63-.88-1.7 0-2.3.91-3.67.91-1.38 0-2.33-1.26-3.43-2.8-1.29-1.82-2.32-4.63-2.32-7.28 0-4.28 2.8-6.55 5.55-6.55 1.45 0 2.68.95 3.6.95.86 0 2.22-1.01 3.9-1.01.61 0 2.89.06 4.37 2.19-.13.09-2.38 1.37-2.38 4.19 0 3.26 2.85 4.42 2.96 4.45z",
122
+ stroke: "currentColor",
123
+ strokeWidth: "1.6",
124
+ strokeLinejoin: "round"
125
+ }
126
+ )
127
+ ]
128
+ }
129
+ );
130
+ }
131
+
132
+ // src/components/ui/BodyHeader.tsx
133
+
134
+ function BodyHeader({
135
+ icon,
136
+ title,
137
+ subtitle,
138
+ variant = "default",
139
+ aside
140
+ }) {
141
+ const iconClasses = [
142
+ "rs-body-header-icon",
143
+ variant === "success" ? "rs-body-header-icon--success" : "",
144
+ variant === "error" ? "rs-body-header-icon--error" : ""
145
+ ].filter(Boolean).join(" ");
146
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
147
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: iconClasses, children: icon }),
148
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header-main", children: [
149
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header-text", children: [
150
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: title }),
151
+ subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-body-header-subtitle", children: subtitle })
152
+ ] }),
153
+ aside && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-body-header-aside", children: aside })
154
+ ] })
155
+ ] });
156
+ }
157
+ BodyHeader.displayName = "BodyHeader";
158
+
159
+ // src/components/ui/Spinner.tsx
160
+
161
+ function Spinner({ className }) {
162
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
163
+ "svg",
164
+ {
165
+ className: `rs-spinner ${className || ""}`,
166
+ fill: "none",
167
+ viewBox: "0 0 20 21",
168
+ children: [
169
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
170
+ "path",
171
+ {
172
+ d: "M10 0.5C8.02 0.5 6.08 1.08 4.44 2.18C2.79 3.28 1.51 4.84 0.76 6.67C0.00 8.50 -0.19 10.51 0.19 12.45C0.57 14.39 1.53 16.17 2.92 17.57C4.32 18.96 6.10 19.92 8.04 20.30C9.98 20.69 11.99 20.49 13.82 19.73C15.65 18.98 17.21 17.70 18.31 16.05C19.41 14.41 20 12.47 20 10.5C20 7.84 18.94 5.30 17.07 3.42C15.19 1.55 12.65 0.5 10 0.5ZM10 17.77C8.56 17.77 7.15 17.34 5.95 16.54C4.76 15.74 3.83 14.61 3.28 13.28C2.73 11.95 2.58 10.49 2.86 9.08C3.14 7.67 3.84 6.37 4.85 5.35C5.87 4.34 7.17 3.64 8.58 3.36C9.99 3.08 11.45 3.23 12.78 3.78C14.11 4.33 15.24 5.26 16.04 6.45C16.84 7.65 17.27 9.06 17.27 10.5C17.27 12.42 16.50 14.27 15.14 15.64C13.77 17.00 11.92 17.77 10 17.77Z",
173
+ fill: "currentColor",
174
+ opacity: 0.3
175
+ }
176
+ ),
177
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
178
+ "path",
179
+ {
180
+ d: "M10 3.22C11.74 3.22 13.42 3.84 14.75 4.95C16.08 6.07 16.96 7.61 17.25 9.31C17.30 9.64 17.46 9.94 17.71 10.15C17.96 10.37 18.28 10.49 18.62 10.5C18.82 10.50 19.01 10.45 19.20 10.37C19.38 10.29 19.54 10.16 19.67 10.01C19.80 9.86 19.89 9.68 19.95 9.49C20.00 9.30 20.01 9.10 19.98 8.90C19.59 6.56 18.38 4.42 16.55 2.88C14.72 1.34 12.40 0.5 10 0.5C7.59 0.5 5.27 1.34 3.44 2.88C1.61 4.42 0.40 6.56 0.01 8.90C-0.01 9.10 -0.00 9.30 0.04 9.49C0.10 9.68 0.19 9.86 0.32 10.01C0.45 10.16 0.61 10.29 0.79 10.37C0.98 10.45 1.17 10.50 1.37 10.5C1.71 10.49 2.03 10.37 2.28 10.15C2.53 9.94 2.69 9.64 2.74 9.31C3.03 7.61 3.91 6.07 5.24 4.95C6.57 3.84 8.25 3.22 10 3.22Z",
181
+ fill: "currentColor"
182
+ }
183
+ )
184
+ ]
185
+ }
186
+ );
187
+ }
188
+
189
+ // src/core/useLatestRef.ts
190
+ var _react = require('react');
191
+ function useLatestRef(value) {
192
+ const ref = _react.useRef.call(void 0, value);
193
+ _react.useEffect.call(void 0, () => {
194
+ ref.current = value;
195
+ }, [value]);
196
+ return ref;
197
+ }
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+ exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronRightIcon = ChevronRightIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.CoinsIcon = CoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowUpRightIcon = ArrowUpRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.CardIcon = CardIcon; exports.BankIcon = BankIcon; exports.UnplugIcon = UnplugIcon; exports.MigrateAssetsIcon = MigrateAssetsIcon; exports.AppleIcon = AppleIcon; exports.BodyHeader = BodyHeader; exports.Spinner = Spinner; exports.useLatestRef = useLatestRef;
@@ -0,0 +1,113 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkLVMNNMOZcjs = require('./chunk-LVMNNMOZ.cjs');
4
+
5
+ // src/core/ramp-utils.ts
6
+ function rampQuery(value) {
7
+ return new URLSearchParams(
8
+ Object.entries(value).filter(([, value2]) => value2 !== void 0).map(([key, value2]) => [key, String(value2)])
9
+ ).toString();
10
+ }
11
+ function rampResourceId(value) {
12
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
13
+ value
14
+ )) {
15
+ throw new Error("Invalid ramp resource ID");
16
+ }
17
+ return value;
18
+ }
19
+
20
+ // src/core/onramp-service.ts
21
+ var RAIL_TYPES = ["BankAch", "BankFedwire", "BankSwift", "BankSepa"];
22
+ var text = (value) => typeof value === "string" && value.length > 0;
23
+ var decimal = (value) => text(value) && /^\+?(?:\d+(?:\.\d*)?|\.\d+)$/.test(value);
24
+ var optionalText = (value) => value === void 0 ? void 0 : text(value) ? value : false;
25
+ function projectBankDetails(input) {
26
+ if (typeof input !== "object" || input === null) return null;
27
+ const d = input;
28
+ if (d.schemaVersion !== 1 || !text(d.capturedAt) || !Number.isFinite(Date.parse(d.capturedAt))) return null;
29
+ if (d.currency !== "USD" && d.currency !== "EUR") return null;
30
+ if (!text(d.accountHolderName)) return null;
31
+ const bankName = optionalText(d.bankName);
32
+ const reference = optionalText(d.reference);
33
+ if (bankName === false || reference === false) return null;
34
+ let bankAddress;
35
+ if (d.bankAddress !== void 0) {
36
+ if (typeof d.bankAddress !== "object" || d.bankAddress === null) return null;
37
+ const a = d.bankAddress;
38
+ const street2 = optionalText(a.street2);
39
+ if (![a.street, a.city, a.postCode, a.state, a.country].every(text) || street2 === false) return null;
40
+ bankAddress = {
41
+ street: a.street,
42
+ city: a.city,
43
+ postCode: a.postCode,
44
+ state: a.state,
45
+ country: a.country,
46
+ ...street2 !== void 0 ? { street2 } : {}
47
+ };
48
+ }
49
+ if (!Array.isArray(d.rails) || d.rails.length === 0) return null;
50
+ const rails = [];
51
+ for (const r of d.rails) {
52
+ if (typeof r !== "object" || r === null) return null;
53
+ const type = RAIL_TYPES.find((t) => t === r.type);
54
+ if (!type || !text(r.accountNumber) || !text(r.bankCode)) return null;
55
+ if (typeof r.fee !== "object" || r.fee === null) return null;
56
+ const f = r.fee;
57
+ if (f.currency !== d.currency || !decimal(f.base) || !decimal(f.percent) || !decimal(f.minimum)) return null;
58
+ if (Number(f.percent) > 100) return null;
59
+ rails.push({
60
+ type,
61
+ accountNumber: r.accountNumber,
62
+ bankCode: r.bankCode,
63
+ fee: { currency: d.currency, base: f.base, percent: f.percent, minimum: f.minimum }
64
+ });
65
+ }
66
+ if (new Set(rails.map((rail) => rail.type)).size !== rails.length) return null;
67
+ return {
68
+ schemaVersion: 1,
69
+ capturedAt: d.capturedAt,
70
+ currency: d.currency,
71
+ accountHolderName: d.accountHolderName,
72
+ ...bankName !== void 0 ? { bankName } : {},
73
+ ...bankAddress ? { bankAddress } : {},
74
+ ...reference !== void 0 ? { reference } : {},
75
+ rails
76
+ };
77
+ }
78
+ function createOnrampService(options) {
79
+ const request = _chunkLVMNNMOZcjs.createBearerTransport.call(void 0, options);
80
+ return {
81
+ // Named fields only, never a spread: this client is Noah's, whatever a
82
+ // caller passes.
83
+ getOptions: ({ currency } = {}) => request(
84
+ `/onramp/options?${rampQuery({ provider: "noah", currency })}`
85
+ ),
86
+ createAccount: ({ currency, optionId }) => request("/onramp/accounts", {
87
+ provider: "noah",
88
+ currency,
89
+ optionId
90
+ }),
91
+ listAccounts: (page = {}) => request(`/onramp/accounts?${rampQuery(page)}`),
92
+ getAccount: (id) => request(`/onramp/accounts/${rampResourceId(id)}`),
93
+ getAccountDetails: async (id) => {
94
+ const result = await request(
95
+ `/onramp/accounts/${rampResourceId(id)}/details`
96
+ );
97
+ const bankDetails = result ? projectBankDetails(result.bankDetails) : null;
98
+ if (!bankDetails) throw new Error("Invalid bank details response");
99
+ return { bankDetails };
100
+ },
101
+ /**
102
+ * The customer's Noah orders, newest first. Filtered on the server, before
103
+ * `limit`, so another provider's orders can never crowd one out of a page.
104
+ */
105
+ listOrders: ({ cursor, limit } = {}) => request(
106
+ `/onramp/orders?${rampQuery({ provider: "noah", cursor, limit })}`
107
+ )
108
+ };
109
+ }
110
+
111
+
112
+
113
+ exports.createOnrampService = createOnrampService;
@@ -1,21 +1,16 @@
1
1
  import {
2
2
  AnalyticsSession,
3
- BodyHeader,
3
+ AssetMetadataProvider,
4
4
  Button,
5
5
  Callout,
6
6
  CdnIcon,
7
7
  ChainCatalogProvider,
8
- ChevronDownIcon,
9
- ChevronLeftIcon,
10
- CircleArrowOutUpLeftIcon,
11
- CloseIcon,
12
8
  HistoryEntryButton,
13
9
  HistoryOverlay,
14
10
  Modal,
15
11
  PoweredBy,
16
12
  ProcessingStep,
17
13
  RpcUrlsProvider,
18
- Spinner,
19
14
  TokenIcon,
20
15
  analyticsTargetProperties,
21
16
  applyTheme,
@@ -32,28 +27,36 @@ import {
32
27
  getAssetId,
33
28
  isHistoryEntryVisible,
34
29
  isNativeAsset,
35
- isRecognizedToken,
36
30
  isSubmissionUncertain,
31
+ useChainCatalog,
37
32
  useDestinationChains,
38
33
  useHistoryPanel,
39
- useLatestRef,
40
34
  useReadClient,
41
35
  useRpcUrls,
42
36
  useStableRpcUrls,
43
37
  useTargetTokens,
38
+ useTokenDisplay,
39
+ useTokenDisplays,
44
40
  useTokenPrices,
45
41
  useWithdrawAnalyticsEmitter,
46
42
  warnRemovedProps
47
- } from "./chunk-5NWLS5BQ.mjs";
43
+ } from "./chunk-OZPMRTW3.mjs";
44
+ import {
45
+ BodyHeader,
46
+ ChevronDownIcon,
47
+ ChevronLeftIcon,
48
+ CircleArrowOutUpLeftIcon,
49
+ CloseIcon,
50
+ Spinner,
51
+ useLatestRef
52
+ } from "./chunk-YY4ZOAH5.mjs";
48
53
  import {
49
54
  NATIVE_TOKEN_ADDRESS,
50
55
  getChainIcon,
51
56
  getChainId,
52
57
  getChainName,
53
- getTokenDecimalsByAddress,
54
- getTokenSymbol,
55
58
  targetChainToCaip2
56
- } from "./chunk-EAGMY3QE.mjs";
59
+ } from "./chunk-E7IMWVMN.mjs";
57
60
 
58
61
  // src/WithdrawModal.tsx
59
62
  import { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo4, useRef as useRef4, useState as useState4 } from "react";
@@ -223,10 +226,12 @@ function WithdrawFormStep({
223
226
  submitting = false,
224
227
  registrationPending = false,
225
228
  registrationError = null,
229
+ decimalsStatus = "ready",
226
230
  onRecipientChange,
227
231
  onSubmit,
228
232
  onFriction
229
233
  }) {
234
+ const decimalsReady = decimalsStatus === "ready";
230
235
  const [recipient, setRecipient] = useState(defaultRecipient ?? "");
231
236
  const [amount, setAmount] = useState(defaultAmount ?? "");
232
237
  const [balance, setBalance] = useState(null);
@@ -241,7 +246,11 @@ function WithdrawFormStep({
241
246
  const onFrictionRef = useLatestRef(onFriction);
242
247
  useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
243
248
  useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
244
- const targetSymbol = getTokenSymbol(targetToken, targetChain);
249
+ const offeredTarget = targetTokenOptions.find(
250
+ (option) => option.address.toLowerCase() === targetToken.toLowerCase()
251
+ );
252
+ const resolvedTargetSymbol = useTokenDisplay(targetChain, targetToken).symbol;
253
+ const targetSymbol = offeredTarget?.symbol ?? resolvedTargetSymbol;
245
254
  const targetChainName = getChainName(targetChain);
246
255
  const isBusy = submitting || isSubmitting;
247
256
  const seededRecipientRef = useRef(defaultRecipient ?? "");
@@ -297,6 +306,7 @@ function WithdrawFormStep({
297
306
  }, [accountAddress, publicClient, publicClientChainId, asset, onFrictionRef]);
298
307
  const formattedBalance = useMemo(() => {
299
308
  if (balance === null) return "...";
309
+ if (!decimalsReady) return "\u2014";
300
310
  try {
301
311
  const raw = formatUnits(balance, asset.decimals);
302
312
  const numeric = Number(raw);
@@ -307,7 +317,7 @@ function WithdrawFormStep({
307
317
  } catch {
308
318
  return "...";
309
319
  }
310
- }, [balance, asset.decimals]);
320
+ }, [balance, asset.decimals, decimalsReady]);
311
321
  useEffect(() => {
312
322
  if (targetTokenOptions.length > 0 || !recipient || !amount) return;
313
323
  onFrictionRef.current?.("route_target_tokens_unavailable");
@@ -323,12 +333,13 @@ function WithdrawFormStep({
323
333
  return null;
324
334
  }, [amount, asset.symbol]);
325
335
  const handleMaxClick = useCallback(() => {
326
- if (balance === null) return;
336
+ if (balance === null || !decimalsReady) return;
327
337
  const maxAmount = formatUnits(balance, asset.decimals);
328
338
  setAmount(maxAmount);
329
339
  setError(null);
330
- }, [balance, asset.decimals]);
340
+ }, [balance, asset.decimals, decimalsReady]);
331
341
  const handleWithdraw = useCallback(async () => {
342
+ if (!decimalsReady) return;
332
343
  if (!recipient || !/^0x[a-fA-F0-9]{40}$/.test(recipient)) {
333
344
  setError("Enter a valid recipient address");
334
345
  onFriction?.("recipient_invalid");
@@ -377,6 +388,7 @@ function WithdrawFormStep({
377
388
  amount,
378
389
  balance,
379
390
  asset.decimals,
391
+ decimalsReady,
380
392
  accountAddress,
381
393
  depositAddress,
382
394
  onSubmit,
@@ -448,7 +460,7 @@ function WithdrawFormStep({
448
460
  type: "button",
449
461
  className: "rs-withdraw-max-btn",
450
462
  onClick: handleMaxClick,
451
- disabled: balance === null,
463
+ disabled: balance === null || !decimalsReady,
452
464
  children: "Max"
453
465
  }
454
466
  ) })
@@ -556,6 +568,7 @@ function WithdrawFormStep({
556
568
  /* @__PURE__ */ jsx(
557
569
  TokenIcon,
558
570
  {
571
+ token: { chain: targetChain, address: targetToken },
559
572
  symbol: targetSymbol,
560
573
  className: "rs-withdraw-dropdown-icon"
561
574
  }
@@ -587,6 +600,7 @@ function WithdrawFormStep({
587
600
  /* @__PURE__ */ jsx(
588
601
  TokenIcon,
589
602
  {
603
+ token: { chain: targetChain, address: option.address },
590
604
  symbol: option.symbol,
591
605
  className: "rs-withdraw-dropdown-icon"
592
606
  }
@@ -603,19 +617,20 @@ function WithdrawFormStep({
603
617
  ] }),
604
618
  error && /* @__PURE__ */ jsx(Callout, { variant: "error", children: error }),
605
619
  !error && registrationError && /* @__PURE__ */ jsx(Callout, { variant: "error", children: registrationError }),
620
+ decimalsStatus === "unresolved" && /* @__PURE__ */ jsx(Callout, { variant: "error", children: "This token's decimals couldn't be determined, so this withdrawal can't be prepared." }),
606
621
  /* @__PURE__ */ jsx(
607
622
  Button,
608
623
  {
609
624
  onClick: handleWithdraw,
610
625
  fullWidth: true,
611
626
  loading: isBusy,
612
- disabled: !recipient || !amount || isBusy || Boolean(registrationError) || // No token list for the selected chain yet. A destination published
627
+ disabled: !recipient || !amount || isBusy || !decimalsReady || Boolean(registrationError) || // No token list for the selected chain yet. A destination published
613
628
  // at runtime becomes selectable as soon as `/chains` resolves, which
614
629
  // can precede its addresses; submitting in that window would send
615
630
  // the previously selected chain's token address to a chain it does
616
631
  // not exist on.
617
632
  targetTokenOptions.length === 0,
618
- children: isBusy ? "Preparing..." : registrationPending ? "Preparing session..." : targetTokenOptions.length === 0 ? "Loading tokens..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
633
+ children: isBusy ? "Preparing..." : decimalsStatus === "pending" ? "Loading token..." : registrationPending ? "Preparing session..." : targetTokenOptions.length === 0 ? "Loading tokens..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
619
634
  }
620
635
  )
621
636
  ] }),
@@ -641,7 +656,7 @@ function WithdrawReviewStep({
641
656
  estimatedTime = "< 1 min",
642
657
  registrationPending = false,
643
658
  registrationError = null,
644
- service,
659
+ targetSymbol: offeredTargetSymbol,
645
660
  onSubmittingChange,
646
661
  onConfirm,
647
662
  onError
@@ -656,12 +671,16 @@ function WithdrawReviewStep({
656
671
  }, [isSubmitting]);
657
672
  const sourceChainName = getChainName(sourceChain);
658
673
  const sourceChainIcon = getChainIcon(sourceChain);
659
- const targetSymbol = getTokenSymbol(targetToken, targetChain);
674
+ const [sourceDisplay, targetDisplay] = useTokenDisplays([
675
+ { chain: sourceChain, address: sourceToken },
676
+ { chain: targetChain, address: targetToken }
677
+ ]);
678
+ const targetSymbol = offeredTargetSymbol ?? targetDisplay.symbol;
660
679
  const targetChainName = getChainName(targetChain);
661
680
  const targetChainIcon = getChainIcon(targetChain);
662
681
  const amountNumber = Number(amount);
663
682
  const formattedSendAmount = formatTokenAmount(amountNumber, sourceSymbol) ?? amount;
664
- const prices = useTokenPrices(service, [
683
+ const prices = useTokenPrices([
665
684
  { chainId: sourceChain, address: sourceToken, symbol: sourceSymbol },
666
685
  { chainId: targetChain, address: targetToken, symbol: targetSymbol }
667
686
  ]);
@@ -669,7 +688,7 @@ function WithdrawReviewStep({
669
688
  sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
670
689
  sourceSymbol,
671
690
  targetSymbol,
672
- sourceTrusted: isRecognizedToken(sourceToken, sourceChain),
691
+ sourceTrusted: sourceDisplay.curated,
673
692
  prices
674
693
  }) ?? // No price for the target token — an honest dash beats a wrong number.
675
694
  "\u2014";
@@ -709,7 +728,13 @@ function WithdrawReviewStep({
709
728
  " ",
710
729
  sourceSymbol
711
730
  ] }),
712
- /* @__PURE__ */ jsx2("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx2(TokenIcon, { symbol: sourceSymbol }) })
731
+ /* @__PURE__ */ jsx2("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx2(
732
+ TokenIcon,
733
+ {
734
+ token: { chain: sourceChain, address: sourceToken },
735
+ symbol: sourceSymbol
736
+ }
737
+ ) })
713
738
  ] })
714
739
  ] }),
715
740
  /* @__PURE__ */ jsxs2("div", { className: "rs-review-detail-row", children: [
@@ -727,7 +752,13 @@ function WithdrawReviewStep({
727
752
  /* @__PURE__ */ jsx2("span", { children: "Receive" }),
728
753
  /* @__PURE__ */ jsxs2("span", { className: "rs-review-detail-value", children: [
729
754
  /* @__PURE__ */ jsx2("span", { children: receiveDisplay }),
730
- /* @__PURE__ */ jsx2("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx2(TokenIcon, { symbol: targetSymbol }) })
755
+ /* @__PURE__ */ jsx2("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx2(
756
+ TokenIcon,
757
+ {
758
+ token: { chain: targetChain, address: targetToken },
759
+ symbol: targetSymbol
760
+ }
761
+ ) })
731
762
  ] })
732
763
  ] }),
733
764
  /* @__PURE__ */ jsxs2("div", { className: "rs-review-detail-row", children: [
@@ -1118,18 +1149,21 @@ function WithdrawFlow({
1118
1149
  onLifecycleRef,
1119
1150
  onErrorRef
1120
1151
  ]);
1152
+ const sourceDisplay = useTokenDisplay(sourceChain, sourceToken);
1153
+ const { isLoading: catalogLoading } = useChainCatalog();
1154
+ const decimalsStatus = sourceDisplay.decimals !== void 0 ? "ready" : sourceDisplay.pending || catalogLoading ? "pending" : "unresolved";
1121
1155
  const asset = useMemo3(() => {
1122
- const symbol = getTokenSymbol(sourceToken, sourceChain);
1123
- const decimals = getTokenDecimalsByAddress(sourceToken, sourceChain);
1156
+ const symbol = sourceDisplay.symbol;
1124
1157
  return {
1125
1158
  id: getAssetId({ chainId: sourceChain, token: sourceToken }),
1126
1159
  chainId: sourceChain,
1127
1160
  token: sourceToken,
1128
1161
  symbol,
1129
1162
  name: symbol,
1130
- decimals
1163
+ // Only read once `decimalsStatus` is ready; the form is blocked before.
1164
+ decimals: sourceDisplay.decimals ?? 0
1131
1165
  };
1132
- }, [sourceChain, sourceToken]);
1166
+ }, [sourceChain, sourceToken, sourceDisplay.symbol, sourceDisplay.decimals]);
1133
1167
  const isSourceNative = sourceToken.toLowerCase() === NATIVE_TOKEN_ADDRESS.toLowerCase();
1134
1168
  const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
1135
1169
  const reviewedTarget = reviewedRecipient ? {
@@ -1262,6 +1296,9 @@ function WithdrawFlow({
1262
1296
  targetChain,
1263
1297
  targetToken
1264
1298
  });
1299
+ if (decimalsStatus !== "ready") {
1300
+ throw new Error("Token decimals are unknown");
1301
+ }
1265
1302
  const amountUnits = parseUnits2(amountValue, asset.decimals);
1266
1303
  const result = await onSendTransaction({
1267
1304
  chainId: sourceChain,
@@ -1329,6 +1366,7 @@ function WithdrawFlow({
1329
1366
  targetChain,
1330
1367
  targetToken,
1331
1368
  asset.decimals,
1369
+ decimalsStatus,
1332
1370
  accountAddress,
1333
1371
  sourceToken,
1334
1372
  sourceChain,
@@ -1435,6 +1473,7 @@ function WithdrawFlow({
1435
1473
  onTargetTokenChange: handleTargetTokenChange,
1436
1474
  registrationPending: registration.kind === "pending" || registration.kind === "stale",
1437
1475
  registrationError: registration.kind === "failed" ? registration.error : null,
1476
+ decimalsStatus,
1438
1477
  onRecipientChange: setRecipientInput,
1439
1478
  onSubmit: async (r, a) => handleFormContinue(r, a),
1440
1479
  onFriction: handleFormFriction
@@ -1450,7 +1489,9 @@ function WithdrawFlow({
1450
1489
  targetToken,
1451
1490
  amount: storeApi.getState().amount ?? "0",
1452
1491
  recipient: storeApi.getState().recipient ?? recipientForRegistration ?? "0x0",
1453
- service,
1492
+ targetSymbol: targetTokenOptions.find(
1493
+ (option) => option.address.toLowerCase() === targetToken.toLowerCase()
1494
+ )?.symbol,
1454
1495
  registrationPending: registration.kind === "pending" || registration.kind === "stale" || !isReviewedTargetReady,
1455
1496
  registrationError: registration.kind === "failed" ? registration.error : null,
1456
1497
  onSubmittingChange,
@@ -1707,7 +1748,7 @@ function WithdrawModal({
1707
1748
  });
1708
1749
  const showBackButton = uiConfig?.showBackButton ?? true;
1709
1750
  const canGoBack = backHandler !== void 0 && !submitting;
1710
- return /* @__PURE__ */ jsx5(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx5(ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ jsx5(WithdrawStoreProvider, { store, children: /* @__PURE__ */ jsx5(
1751
+ return /* @__PURE__ */ jsx5(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx5(ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ jsx5(AssetMetadataProvider, { service, children: /* @__PURE__ */ jsx5(WithdrawStoreProvider, { store, children: /* @__PURE__ */ jsx5(
1711
1752
  Modal,
1712
1753
  {
1713
1754
  isOpen,
@@ -1810,7 +1851,7 @@ function WithdrawModal({
1810
1851
  }
1811
1852
  )
1812
1853
  }
1813
- ) }) }) });
1854
+ ) }) }) }) });
1814
1855
  }
1815
1856
 
1816
1857
  export {
@@ -0,0 +1,19 @@
1
+ import {
2
+ createBearerTransport
3
+ } from "./chunk-YQCRXJIL.mjs";
4
+
5
+ // src/core/compliance-service.ts
6
+ function getComplianceStatus(options) {
7
+ return createBearerTransport(options)("/compliance/status");
8
+ }
9
+ function startComplianceVerification(options) {
10
+ return createBearerTransport(options)(
11
+ "/compliance/verification",
12
+ {}
13
+ );
14
+ }
15
+
16
+ export {
17
+ getComplianceStatus,
18
+ startComplianceVerification
19
+ };