@chipi-stack/chipi-react 0.1.0 → 1.0.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/dist/index.d.mts CHANGED
@@ -3,9 +3,7 @@ import { ReactNode } from 'react';
3
3
  import { ChipiSDK } from '@chipi-stack/backend';
4
4
  import { ChipiSDKConfig } from '@chipi-stack/types';
5
5
  export * from '@chipi-stack/types';
6
- export { useApprove, useCallAnyContract, useCreateWallet, useExecuteTransaction, usePurchaseSku, useSkuTransactions, useSkus, useStakeVesuUsdc, useTransfer, useWallets, useWithdrawVesuUsdc } from './hooks.mjs';
7
- export { SkuList, SkuPurchaseForm, TransactionForm, WalletBalance, WalletCreator } from './components.mjs';
8
- import '@tanstack/react-query';
6
+ export { useApprove, useCallAnyContract, useCreateWallet, useExecuteTransaction, useRecordSendTransaction, useStakeVesuUsdc, useTransfer, useWithdrawVesuUsdc } from './hooks.mjs';
9
7
 
10
8
  interface ChipiContextValue {
11
9
  chipiSDK: ChipiSDK;
package/dist/index.d.ts CHANGED
@@ -3,9 +3,7 @@ import { ReactNode } from 'react';
3
3
  import { ChipiSDK } from '@chipi-stack/backend';
4
4
  import { ChipiSDKConfig } from '@chipi-stack/types';
5
5
  export * from '@chipi-stack/types';
6
- export { useApprove, useCallAnyContract, useCreateWallet, useExecuteTransaction, usePurchaseSku, useSkuTransactions, useSkus, useStakeVesuUsdc, useTransfer, useWallets, useWithdrawVesuUsdc } from './hooks.js';
7
- export { SkuList, SkuPurchaseForm, TransactionForm, WalletBalance, WalletCreator } from './components.js';
8
- import '@tanstack/react-query';
6
+ export { useApprove, useCallAnyContract, useCreateWallet, useExecuteTransaction, useRecordSendTransaction, useStakeVesuUsdc, useTransfer, useWithdrawVesuUsdc } from './hooks.js';
9
7
 
10
8
  interface ChipiContextValue {
11
9
  chipiSDK: ChipiSDK;
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ var React = require('react');
4
4
  var backend = require('@chipi-stack/backend');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var reactQuery = require('@tanstack/react-query');
7
- var shared = require('@chipi-stack/shared');
8
7
 
9
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
9
 
@@ -33,7 +32,10 @@ function useChipiContext() {
33
32
  function useCreateWallet() {
34
33
  const { chipiSDK } = useChipiContext();
35
34
  const mutation = reactQuery.useMutation({
36
- mutationFn: (params) => chipiSDK.createWallet(params)
35
+ mutationFn: (input) => chipiSDK.createWallet({
36
+ params: input.params,
37
+ bearerToken: input.bearerToken
38
+ })
37
39
  });
38
40
  return {
39
41
  createWallet: mutation.mutate,
@@ -46,20 +48,16 @@ function useCreateWallet() {
46
48
  reset: mutation.reset
47
49
  };
48
50
  }
49
- function useWallets(params) {
50
- const { chipiSDK } = useChipiContext();
51
- const { enabled = true, ...queryParams } = params;
52
- return reactQuery.useQuery({
53
- queryKey: ["wallets", queryParams],
54
- queryFn: () => chipiSDK.wallets.getWallets(queryParams),
55
- enabled: enabled && !!queryParams.apiKeyId && !!queryParams.orgId
56
- });
57
- }
58
51
  function useTransfer() {
59
52
  const { chipiSDK } = useChipiContext();
60
- const mutation = reactQuery.useMutation({
61
- mutationFn: (params) => chipiSDK.transfer(params)
62
- });
53
+ const mutation = reactQuery.useMutation(
54
+ {
55
+ mutationFn: (input) => chipiSDK.transfer({
56
+ params: input.params,
57
+ bearerToken: input.bearerToken
58
+ })
59
+ }
60
+ );
63
61
  return {
64
62
  transfer: mutation.mutate,
65
63
  transferAsync: mutation.mutateAsync,
@@ -103,40 +101,6 @@ function useExecuteTransaction() {
103
101
  reset: mutation.reset
104
102
  };
105
103
  }
106
- function useSkus(params = {}) {
107
- const { chipiSDK } = useChipiContext();
108
- const { enabled = true, ...queryParams } = params;
109
- return reactQuery.useQuery({
110
- queryKey: ["skus", queryParams],
111
- queryFn: () => chipiSDK.skus.findSkus(queryParams),
112
- enabled
113
- });
114
- }
115
- function useSkuTransactions(params) {
116
- const { chipiSDK } = useChipiContext();
117
- const { enabled = true, walletAddress, ...queryParams } = params;
118
- return reactQuery.useQuery({
119
- queryKey: ["sku-transactions", { walletAddress, ...queryParams }],
120
- queryFn: () => chipiSDK.skus.getSkuTransactionsByWallet(walletAddress, queryParams),
121
- enabled: enabled && !!walletAddress
122
- });
123
- }
124
- function usePurchaseSku() {
125
- const { chipiSDK } = useChipiContext();
126
- const mutation = reactQuery.useMutation({
127
- mutationFn: (params) => chipiSDK.skus.purchaseSku(params)
128
- });
129
- return {
130
- purchaseSku: mutation.mutate,
131
- purchaseSkuAsync: mutation.mutateAsync,
132
- data: mutation.data,
133
- isLoading: mutation.isPending,
134
- isError: mutation.isError,
135
- error: mutation.error,
136
- isSuccess: mutation.isSuccess,
137
- reset: mutation.reset
138
- };
139
- }
140
104
  function useStakeVesuUsdc() {
141
105
  const { chipiSDK } = useChipiContext();
142
106
  const mutation = reactQuery.useMutation({
@@ -185,440 +149,35 @@ function useCallAnyContract() {
185
149
  reset: mutation.reset
186
150
  };
187
151
  }
188
- function WalletCreator({ onWalletCreated, className, children }) {
189
- const [encryptKey, setEncryptKey] = React.useState("");
190
- const [bearerToken, setBearerToken] = React.useState("");
191
- const { createWallet, isLoading, isError, error, data, isSuccess } = useCreateWallet();
192
- const handleSubmit = (e) => {
193
- e.preventDefault();
194
- if (!encryptKey || !bearerToken) return;
195
- createWallet({
196
- encryptKey,
197
- bearerToken
198
- });
199
- };
200
- React__default.default.useEffect(() => {
201
- if (isSuccess && data && onWalletCreated) {
202
- onWalletCreated(data);
203
- }
204
- }, [isSuccess, data, onWalletCreated]);
205
- if (children) {
206
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
207
- }
208
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
209
- /* @__PURE__ */ jsxRuntime.jsx("h2", { children: "Create Wallet" }),
210
- isError && error && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { color: "red", marginBottom: "1rem" }, children: [
211
- "Error: ",
212
- error.message
213
- ] }),
214
- isSuccess && data && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { color: "green", marginBottom: "1rem" }, children: [
215
- "Wallet created successfully! Address: ",
216
- data.walletPublicKey
217
- ] }),
218
- /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
219
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
220
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "encryptKey", children: "Encrypt Key:" }),
221
- /* @__PURE__ */ jsxRuntime.jsx(
222
- "input",
223
- {
224
- id: "encryptKey",
225
- type: "password",
226
- value: encryptKey,
227
- onChange: (e) => setEncryptKey(e.target.value),
228
- required: true,
229
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
230
- }
231
- )
232
- ] }),
233
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
234
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "bearerToken", children: "Bearer Token:" }),
235
- /* @__PURE__ */ jsxRuntime.jsx(
236
- "input",
237
- {
238
- id: "bearerToken",
239
- type: "text",
240
- value: bearerToken,
241
- onChange: (e) => setBearerToken(e.target.value),
242
- required: true,
243
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
244
- }
245
- )
246
- ] }),
247
- /* @__PURE__ */ jsxRuntime.jsx(
248
- "button",
249
- {
250
- type: "submit",
251
- disabled: isLoading || !encryptKey || !bearerToken,
252
- style: {
253
- padding: "0.75rem 1.5rem",
254
- backgroundColor: isLoading ? "#ccc" : "#007bff",
255
- color: "white",
256
- border: "none",
257
- borderRadius: "0.25rem",
258
- cursor: isLoading ? "not-allowed" : "pointer"
259
- },
260
- children: isLoading ? "Creating..." : "Create Wallet"
261
- }
262
- )
263
- ] })
264
- ] });
265
- }
266
- function WalletBalance({
267
- address,
268
- balance,
269
- currency = "USD",
270
- isLoading = false,
271
- className
272
- }) {
273
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
274
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "0.5rem" }, children: [
275
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Wallet:" }),
276
- " ",
277
- shared.formatAddress(address)
278
- ] }),
279
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
280
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Balance:" }),
281
- " ",
282
- isLoading ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Loading..." }) : balance !== void 0 ? shared.formatCurrency(balance, currency) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "--" })
283
- ] })
284
- ] });
285
- }
286
- function TransactionForm({
287
- wallet,
288
- encryptKey,
289
- bearerToken,
290
- onTransactionComplete,
291
- className
292
- }) {
293
- const [contractAddress, setContractAddress] = React.useState("");
294
- const [recipient, setRecipient] = React.useState("");
295
- const [amount, setAmount] = React.useState("");
296
- const [decimals, setDecimals] = React.useState(18);
297
- const { transfer, isLoading, isError, error, data, isSuccess } = useTransfer();
298
- const handleSubmit = (e) => {
299
- e.preventDefault();
300
- if (!contractAddress || !recipient || !amount) return;
301
- transfer({
302
- encryptKey,
303
- wallet,
304
- contractAddress,
305
- recipient,
306
- amount: parseFloat(amount),
307
- decimals,
308
- bearerToken
309
- });
310
- };
311
- React__default.default.useEffect(() => {
312
- if (isSuccess && data && onTransactionComplete) {
313
- onTransactionComplete(data);
314
- }
315
- }, [isSuccess, data, onTransactionComplete]);
316
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
317
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Transfer Tokens" }),
318
- isError && error && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { color: "red", marginBottom: "1rem" }, children: [
319
- "Error: ",
320
- error.message
321
- ] }),
322
- isSuccess && data && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { color: "green", marginBottom: "1rem" }, children: [
323
- "Transaction successful! Hash: ",
324
- data
325
- ] }),
326
- /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
327
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
328
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "contractAddress", children: "Token Contract:" }),
329
- /* @__PURE__ */ jsxRuntime.jsx(
330
- "input",
331
- {
332
- id: "contractAddress",
333
- type: "text",
334
- value: contractAddress,
335
- onChange: (e) => setContractAddress(e.target.value),
336
- placeholder: "0x...",
337
- required: true,
338
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
339
- }
340
- )
341
- ] }),
342
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
343
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "recipient", children: "Recipient:" }),
344
- /* @__PURE__ */ jsxRuntime.jsx(
345
- "input",
346
- {
347
- id: "recipient",
348
- type: "text",
349
- value: recipient,
350
- onChange: (e) => setRecipient(e.target.value),
351
- placeholder: "0x...",
352
- required: true,
353
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
354
- }
355
- )
356
- ] }),
357
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
358
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "amount", children: "Amount:" }),
359
- /* @__PURE__ */ jsxRuntime.jsx(
360
- "input",
361
- {
362
- id: "amount",
363
- type: "number",
364
- step: "any",
365
- value: amount,
366
- onChange: (e) => setAmount(e.target.value),
367
- required: true,
368
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
369
- }
370
- )
371
- ] }),
372
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
373
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "decimals", children: "Decimals:" }),
374
- /* @__PURE__ */ jsxRuntime.jsx(
375
- "input",
376
- {
377
- id: "decimals",
378
- type: "number",
379
- value: decimals,
380
- onChange: (e) => setDecimals(parseInt(e.target.value)),
381
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
382
- }
383
- )
384
- ] }),
385
- /* @__PURE__ */ jsxRuntime.jsx(
386
- "button",
387
- {
388
- type: "submit",
389
- disabled: isLoading || !contractAddress || !recipient || !amount,
390
- style: {
391
- padding: "0.75rem 1.5rem",
392
- backgroundColor: isLoading ? "#ccc" : "#007bff",
393
- color: "white",
394
- border: "none",
395
- borderRadius: "0.25rem",
396
- cursor: isLoading ? "not-allowed" : "pointer"
397
- },
398
- children: isLoading ? "Sending..." : "Send Transaction"
399
- }
400
- )
401
- ] })
402
- ] });
403
- }
404
- function SkuList({ categories, onSkuSelect, className }) {
405
- const { data: skus, isLoading, isError, error } = useSkus({ categories });
406
- if (isLoading) {
407
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: "Loading SKUs..." });
408
- }
409
- if (isError) {
410
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { color: "red" }, children: [
411
- "Error loading SKUs: ",
412
- error?.message
413
- ] }) });
414
- }
415
- if (!skus || skus.length === 0) {
416
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "No SKUs available." }) });
417
- }
418
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
419
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Available SKUs" }),
420
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: "1rem", gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))" }, children: skus.map((sku) => /* @__PURE__ */ jsxRuntime.jsxs(
421
- "div",
422
- {
423
- style: {
424
- border: "1px solid #ddd",
425
- borderRadius: "0.5rem",
426
- padding: "1rem",
427
- backgroundColor: "white",
428
- cursor: onSkuSelect ? "pointer" : "default"
429
- },
430
- onClick: () => onSkuSelect?.(sku),
431
- children: [
432
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: "0.5rem" }, children: /* @__PURE__ */ jsxRuntime.jsx("h4", { style: { margin: 0, fontSize: "1.1rem" }, children: sku.name }) }),
433
- sku.description && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: "0.5rem", color: "#666", fontSize: "0.9rem" }, children: sku.description }),
434
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: "0.5rem" }, children: /* @__PURE__ */ jsxRuntime.jsx(
435
- "span",
436
- {
437
- style: {
438
- backgroundColor: "#f0f0f0",
439
- padding: "0.25rem 0.5rem",
440
- borderRadius: "0.25rem",
441
- fontSize: "0.8rem",
442
- color: "#666"
443
- },
444
- children: sku.category
445
- }
446
- ) }),
447
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
448
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "1.2rem", fontWeight: "bold" }, children: shared.formatCurrency(sku.price, sku.currency) }),
449
- /* @__PURE__ */ jsxRuntime.jsx(
450
- "div",
451
- {
452
- style: {
453
- color: sku.isActive ? "green" : "red",
454
- fontSize: "0.9rem",
455
- fontWeight: "bold"
456
- },
457
- children: sku.isActive ? "Available" : "Unavailable"
458
- }
459
- )
460
- ] })
461
- ]
462
- },
463
- sku.id
464
- )) })
465
- ] });
466
- }
467
- function SkuPurchaseForm({
468
- sku,
469
- walletAddress,
470
- onPurchaseComplete,
471
- className
472
- }) {
473
- const [chain, setChain] = React.useState("STARKNET_MAINNET");
474
- const [chainToken, setChainToken] = React.useState("USDC");
475
- const [reference, setReference] = React.useState("");
476
- const [transactionHash, setTransactionHash] = React.useState("");
477
- const { purchaseSku, isLoading, isError, error, data, isSuccess } = usePurchaseSku();
478
- const handleSubmit = (e) => {
479
- e.preventDefault();
480
- if (!reference || !transactionHash) return;
481
- purchaseSku({
482
- skuId: sku.id,
483
- walletAddress,
484
- chain,
485
- chainToken,
486
- mxnAmount: sku.price,
487
- reference,
488
- transactionHash
489
- });
152
+ function useRecordSendTransaction() {
153
+ const { chipiSDK } = useChipiContext();
154
+ const mutation = reactQuery.useMutation({
155
+ mutationFn: (input) => chipiSDK.recordSendTransaction({
156
+ params: input.params,
157
+ bearerToken: input.bearerToken
158
+ })
159
+ });
160
+ return {
161
+ recordSendTransaction: mutation.mutate,
162
+ recordSendTransactionAsync: mutation.mutateAsync,
163
+ data: mutation.data,
164
+ isLoading: mutation.isPending,
165
+ isError: mutation.isError,
166
+ error: mutation.error,
167
+ isSuccess: mutation.isSuccess,
168
+ reset: mutation.reset
490
169
  };
491
- React__default.default.useEffect(() => {
492
- if (isSuccess && data && onPurchaseComplete) {
493
- onPurchaseComplete(data.transaction.transactionHash);
494
- }
495
- }, [isSuccess, data, onPurchaseComplete]);
496
- if (!sku.isActive) {
497
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "red", textAlign: "center", padding: "2rem" }, children: "This SKU is currently unavailable for purchase." }) });
498
- }
499
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
500
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Purchase SKU" }),
501
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1.5rem", padding: "1rem", backgroundColor: "#f9f9f9", borderRadius: "0.5rem" }, children: [
502
- /* @__PURE__ */ jsxRuntime.jsx("h4", { style: { margin: "0 0 0.5rem 0" }, children: sku.name }),
503
- sku.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 0.5rem 0", color: "#666" }, children: sku.description }),
504
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "1.2rem", fontWeight: "bold" }, children: [
505
- "Price: ",
506
- shared.formatCurrency(sku.price, sku.currency)
507
- ] })
508
- ] }),
509
- isError && error && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { color: "red", marginBottom: "1rem" }, children: [
510
- "Error: ",
511
- error.message
512
- ] }),
513
- isSuccess && data && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { color: "green", marginBottom: "1rem" }, children: [
514
- "Purchase successful! Transaction: ",
515
- data.transaction.transactionHash
516
- ] }),
517
- /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, children: [
518
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
519
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "chain", children: "Chain:" }),
520
- /* @__PURE__ */ jsxRuntime.jsxs(
521
- "select",
522
- {
523
- id: "chain",
524
- value: chain,
525
- onChange: (e) => setChain(e.target.value),
526
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" },
527
- children: [
528
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "STARKNET_MAINNET", children: "Starknet Mainnet" }),
529
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "STARKNET_SEPOLIA", children: "Starknet Sepolia" })
530
- ]
531
- }
532
- )
533
- ] }),
534
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
535
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "chainToken", children: "Token:" }),
536
- /* @__PURE__ */ jsxRuntime.jsxs(
537
- "select",
538
- {
539
- id: "chainToken",
540
- value: chainToken,
541
- onChange: (e) => setChainToken(e.target.value),
542
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" },
543
- children: [
544
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "USDC", children: "USDC" }),
545
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "USDT", children: "USDT" }),
546
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "ETH", children: "ETH" }),
547
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "STRK", children: "STRK" }),
548
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "DAI", children: "DAI" })
549
- ]
550
- }
551
- )
552
- ] }),
553
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
554
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "reference", children: "Reference:" }),
555
- /* @__PURE__ */ jsxRuntime.jsx(
556
- "input",
557
- {
558
- id: "reference",
559
- type: "text",
560
- value: reference,
561
- onChange: (e) => setReference(e.target.value),
562
- placeholder: "Transaction reference",
563
- required: true,
564
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
565
- }
566
- )
567
- ] }),
568
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "1rem" }, children: [
569
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "transactionHash", children: "Transaction Hash:" }),
570
- /* @__PURE__ */ jsxRuntime.jsx(
571
- "input",
572
- {
573
- id: "transactionHash",
574
- type: "text",
575
- value: transactionHash,
576
- onChange: (e) => setTransactionHash(e.target.value),
577
- placeholder: "0x...",
578
- required: true,
579
- style: { width: "100%", padding: "0.5rem", marginTop: "0.25rem" }
580
- }
581
- )
582
- ] }),
583
- /* @__PURE__ */ jsxRuntime.jsx(
584
- "button",
585
- {
586
- type: "submit",
587
- disabled: isLoading || !reference || !transactionHash,
588
- style: {
589
- width: "100%",
590
- padding: "0.75rem",
591
- backgroundColor: isLoading ? "#ccc" : "#28a745",
592
- color: "white",
593
- border: "none",
594
- borderRadius: "0.25rem",
595
- fontSize: "1rem",
596
- cursor: isLoading ? "not-allowed" : "pointer"
597
- },
598
- children: isLoading ? "Processing..." : `Purchase for ${shared.formatCurrency(sku.price, sku.currency)}`
599
- }
600
- )
601
- ] })
602
- ] });
603
170
  }
604
171
 
605
172
  exports.ChipiProvider = ChipiProvider;
606
- exports.SkuList = SkuList;
607
- exports.SkuPurchaseForm = SkuPurchaseForm;
608
- exports.TransactionForm = TransactionForm;
609
- exports.WalletBalance = WalletBalance;
610
- exports.WalletCreator = WalletCreator;
611
173
  exports.useApprove = useApprove;
612
174
  exports.useCallAnyContract = useCallAnyContract;
613
175
  exports.useChipiContext = useChipiContext;
614
176
  exports.useCreateWallet = useCreateWallet;
615
177
  exports.useExecuteTransaction = useExecuteTransaction;
616
- exports.usePurchaseSku = usePurchaseSku;
617
- exports.useSkuTransactions = useSkuTransactions;
618
- exports.useSkus = useSkus;
178
+ exports.useRecordSendTransaction = useRecordSendTransaction;
619
179
  exports.useStakeVesuUsdc = useStakeVesuUsdc;
620
180
  exports.useTransfer = useTransfer;
621
- exports.useWallets = useWallets;
622
181
  exports.useWithdrawVesuUsdc = useWithdrawVesuUsdc;
623
182
  //# sourceMappingURL=index.js.map
624
183
  //# sourceMappingURL=index.js.map