@rhinestone/deposit-modal 0.3.0 → 0.3.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 (40) hide show
  1. package/dist/{DepositModalReown-6SUEC5IU.mjs → DepositModalReown-G7UX4IBZ.mjs} +5 -3
  2. package/dist/{DepositModalReown-DNW4GH6L.cjs → DepositModalReown-MECHBE6P.cjs} +8 -6
  3. package/dist/{WithdrawModalReown-7UAGSOSU.mjs → WithdrawModalReown-CUJAFUQM.mjs} +4 -3
  4. package/dist/{WithdrawModalReown-OUWBSKSM.cjs → WithdrawModalReown-WJ6VBZKK.cjs} +7 -6
  5. package/dist/{caip-CrQ2KKU-.d.cts → caip-CsslyHGL.d.cts} +1 -1
  6. package/dist/{caip-CrQ2KKU-.d.ts → caip-CsslyHGL.d.ts} +1 -1
  7. package/dist/{chunk-KAWJABTW.mjs → chunk-3C35DVPE.mjs} +2 -291
  8. package/dist/chunk-AJHFNHG3.cjs +295 -0
  9. package/dist/chunk-BAEB5AFZ.mjs +212 -0
  10. package/dist/{chunk-TKQYTBU6.mjs → chunk-DZQD3DAV.mjs} +7 -5
  11. package/dist/{chunk-2SMS542Q.cjs → chunk-LEL6GMEQ.cjs} +56 -54
  12. package/dist/{chunk-RABZINV3.cjs → chunk-MQIJZNTP.cjs} +3 -292
  13. package/dist/{chunk-KJ2RR2D4.mjs → chunk-QYSCCX4K.mjs} +534 -413
  14. package/dist/chunk-R5CPOBCF.cjs +212 -0
  15. package/dist/{chunk-GPSBM66J.mjs → chunk-R5WDHHVM.mjs} +1 -1
  16. package/dist/{chunk-VVJAIMKB.cjs → chunk-SPUZLWQS.cjs} +783 -662
  17. package/dist/chunk-TQ2AYMWS.mjs +295 -0
  18. package/dist/{chunk-33H6O5UU.cjs → chunk-ULEAK63T.cjs} +2 -2
  19. package/dist/constants.d.cts +1 -1
  20. package/dist/constants.d.ts +1 -1
  21. package/dist/deposit.cjs +5 -3
  22. package/dist/deposit.d.cts +4 -4
  23. package/dist/deposit.d.ts +4 -4
  24. package/dist/deposit.mjs +4 -2
  25. package/dist/index.cjs +6 -4
  26. package/dist/index.d.cts +4 -3
  27. package/dist/index.d.ts +4 -3
  28. package/dist/index.mjs +5 -3
  29. package/dist/polymarket.cjs +64 -0
  30. package/dist/polymarket.d.cts +57 -0
  31. package/dist/polymarket.d.ts +57 -0
  32. package/dist/polymarket.mjs +64 -0
  33. package/dist/styles.css +34 -0
  34. package/dist/{types-BMcGO5k_.d.cts → types-RzfAD14B.d.cts} +9 -0
  35. package/dist/{types-BMcGO5k_.d.ts → types-RzfAD14B.d.ts} +9 -0
  36. package/dist/withdraw.cjs +4 -3
  37. package/dist/withdraw.d.cts +4 -4
  38. package/dist/withdraw.d.ts +4 -4
  39. package/dist/withdraw.mjs +3 -2
  40. package/package.json +15 -2
@@ -3201,7 +3201,7 @@ function ProcessingStep({
3201
3201
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
3202
3202
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
3203
3203
  sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceChainIcon, alt: "" }) }),
3204
- isSwappedOrder && sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3204
+ sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3205
3205
  "a",
3206
3206
  {
3207
3207
  href: sourceExplorerUrl,
@@ -3219,7 +3219,7 @@ function ProcessingStep({
3219
3219
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
3220
3220
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
3221
3221
  targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetChainIcon, alt: "" }) }),
3222
- isSwappedOrder && destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3222
+ destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3223
3223
  "a",
3224
3224
  {
3225
3225
  href: destExplorerUrl,
@@ -3371,291 +3371,6 @@ function ProcessingStep({
3371
3371
  ] });
3372
3372
  }
3373
3373
 
3374
- // src/core/safe.ts
3375
-
3376
-
3377
-
3378
-
3379
-
3380
-
3381
-
3382
-
3383
-
3384
-
3385
- var SAFE_ABI = [
3386
- {
3387
- type: "function",
3388
- name: "isOwner",
3389
- stateMutability: "view",
3390
- inputs: [{ name: "owner", type: "address" }],
3391
- outputs: [{ name: "", type: "bool" }]
3392
- },
3393
- {
3394
- type: "function",
3395
- name: "nonce",
3396
- stateMutability: "view",
3397
- inputs: [],
3398
- outputs: [{ type: "uint256" }]
3399
- },
3400
- {
3401
- type: "function",
3402
- name: "execTransaction",
3403
- stateMutability: "payable",
3404
- inputs: [
3405
- { name: "to", type: "address" },
3406
- { name: "value", type: "uint256" },
3407
- { name: "data", type: "bytes" },
3408
- { name: "operation", type: "uint8" },
3409
- { name: "safeTxGas", type: "uint256" },
3410
- { name: "baseGas", type: "uint256" },
3411
- { name: "gasPrice", type: "uint256" },
3412
- { name: "gasToken", type: "address" },
3413
- { name: "refundReceiver", type: "address" },
3414
- { name: "signatures", type: "bytes" }
3415
- ],
3416
- outputs: [{ name: "success", type: "bool" }]
3417
- },
3418
- {
3419
- type: "event",
3420
- name: "ExecutionSuccess",
3421
- inputs: [
3422
- { name: "txHash", type: "bytes32", indexed: true },
3423
- { name: "payment", type: "uint256", indexed: false }
3424
- ],
3425
- anonymous: false
3426
- },
3427
- {
3428
- type: "event",
3429
- name: "ExecutionFailure",
3430
- inputs: [
3431
- { name: "txHash", type: "bytes32", indexed: true },
3432
- { name: "payment", type: "uint256", indexed: false }
3433
- ],
3434
- anonymous: false
3435
- }
3436
- ];
3437
- async function executeSafeEthTransfer(params) {
3438
- const {
3439
- walletClient,
3440
- publicClient,
3441
- safeAddress,
3442
- recipient,
3443
- amount,
3444
- chainId
3445
- } = params;
3446
- const account = walletClient.account;
3447
- const chain = walletClient.chain;
3448
- if (!account || !chain) {
3449
- throw new Error("Wallet not connected");
3450
- }
3451
- if (chain.id !== chainId) {
3452
- throw new Error(`Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, chainId)} to sign`);
3453
- }
3454
- const isOwner = await publicClient.readContract({
3455
- address: safeAddress,
3456
- abi: SAFE_ABI,
3457
- functionName: "isOwner",
3458
- args: [account.address]
3459
- });
3460
- if (!isOwner) {
3461
- throw new Error("Connected wallet is not a Safe owner");
3462
- }
3463
- const safeTx = {
3464
- to: recipient,
3465
- value: amount,
3466
- data: "0x",
3467
- operation: 0,
3468
- safeTxGas: 0n,
3469
- baseGas: 0n,
3470
- gasPrice: 0n,
3471
- gasToken: _viem.zeroAddress,
3472
- refundReceiver: _viem.zeroAddress
3473
- };
3474
- const signature = _viem.concat.call(void 0, [
3475
- _viem.pad.call(void 0, account.address, { size: 32 }),
3476
- _viem.pad.call(void 0, _viem.toHex.call(void 0, 0), { size: 32 }),
3477
- _viem.toHex.call(void 0, 1, { size: 1 })
3478
- ]);
3479
- const txHash = await walletClient.writeContract({
3480
- account,
3481
- chain,
3482
- address: safeAddress,
3483
- abi: SAFE_ABI,
3484
- functionName: "execTransaction",
3485
- args: [
3486
- safeTx.to,
3487
- safeTx.value,
3488
- safeTx.data,
3489
- safeTx.operation,
3490
- safeTx.safeTxGas,
3491
- safeTx.baseGas,
3492
- safeTx.gasPrice,
3493
- safeTx.gasToken,
3494
- safeTx.refundReceiver,
3495
- signature
3496
- ]
3497
- });
3498
- const receipt = await publicClient.waitForTransactionReceipt({
3499
- hash: txHash
3500
- });
3501
- const safeLogs = receipt.logs.filter(
3502
- (log) => log.address.toLowerCase() === safeAddress.toLowerCase()
3503
- );
3504
- const parsed = _viem.parseEventLogs.call(void 0, {
3505
- abi: SAFE_ABI,
3506
- logs: safeLogs,
3507
- strict: false
3508
- });
3509
- const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
3510
- if (failed) {
3511
- throw new Error("Safe transaction failed");
3512
- }
3513
- const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
3514
- if (!succeeded) {
3515
- throw new Error("Safe transaction status unavailable");
3516
- }
3517
- return { txHash };
3518
- }
3519
- async function executeSafeErc20Transfer(params) {
3520
- const {
3521
- walletClient,
3522
- publicClient,
3523
- safeAddress,
3524
- tokenAddress,
3525
- recipient,
3526
- amount,
3527
- chainId
3528
- } = params;
3529
- const account = walletClient.account;
3530
- const chain = walletClient.chain;
3531
- if (!account || !chain) {
3532
- throw new Error("Wallet not connected");
3533
- }
3534
- if (chain.id !== chainId) {
3535
- throw new Error(`Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, chainId)} to sign`);
3536
- }
3537
- const isOwner = await publicClient.readContract({
3538
- address: safeAddress,
3539
- abi: SAFE_ABI,
3540
- functionName: "isOwner",
3541
- args: [account.address]
3542
- });
3543
- if (!isOwner) {
3544
- throw new Error("Connected wallet is not a Safe owner");
3545
- }
3546
- const data = _viem.encodeFunctionData.call(void 0, {
3547
- abi: _viem.erc20Abi,
3548
- functionName: "transfer",
3549
- args: [recipient, amount]
3550
- });
3551
- const safeTx = {
3552
- to: tokenAddress,
3553
- value: 0n,
3554
- data,
3555
- operation: 0,
3556
- safeTxGas: 0n,
3557
- baseGas: 0n,
3558
- gasPrice: 0n,
3559
- gasToken: _viem.zeroAddress,
3560
- refundReceiver: _viem.zeroAddress
3561
- };
3562
- const signature = _viem.concat.call(void 0, [
3563
- _viem.pad.call(void 0, account.address, { size: 32 }),
3564
- _viem.pad.call(void 0, _viem.toHex.call(void 0, 0), { size: 32 }),
3565
- _viem.toHex.call(void 0, 1, { size: 1 })
3566
- ]);
3567
- const txHash = await walletClient.writeContract({
3568
- account,
3569
- chain,
3570
- address: safeAddress,
3571
- abi: SAFE_ABI,
3572
- functionName: "execTransaction",
3573
- args: [
3574
- safeTx.to,
3575
- safeTx.value,
3576
- safeTx.data,
3577
- safeTx.operation,
3578
- safeTx.safeTxGas,
3579
- safeTx.baseGas,
3580
- safeTx.gasPrice,
3581
- safeTx.gasToken,
3582
- safeTx.refundReceiver,
3583
- signature
3584
- ]
3585
- });
3586
- const receipt = await publicClient.waitForTransactionReceipt({
3587
- hash: txHash
3588
- });
3589
- const safeLogs = receipt.logs.filter(
3590
- (log) => log.address.toLowerCase() === safeAddress.toLowerCase()
3591
- );
3592
- const parsed = _viem.parseEventLogs.call(void 0, {
3593
- abi: SAFE_ABI,
3594
- logs: safeLogs,
3595
- strict: false
3596
- });
3597
- const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
3598
- if (failed) {
3599
- throw new Error("Safe transaction failed");
3600
- }
3601
- const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
3602
- if (!succeeded) {
3603
- throw new Error("Safe transaction status unavailable");
3604
- }
3605
- return { txHash };
3606
- }
3607
- var SAFE_TX_TYPES = {
3608
- SafeTx: [
3609
- { name: "to", type: "address" },
3610
- { name: "value", type: "uint256" },
3611
- { name: "data", type: "bytes" },
3612
- { name: "operation", type: "uint8" },
3613
- { name: "safeTxGas", type: "uint256" },
3614
- { name: "baseGas", type: "uint256" },
3615
- { name: "gasPrice", type: "uint256" },
3616
- { name: "gasToken", type: "address" },
3617
- { name: "refundReceiver", type: "address" },
3618
- { name: "nonce", type: "uint256" }
3619
- ]
3620
- };
3621
- async function buildSafeTransaction(params) {
3622
- const { publicClient, safeAddress, to, value, data, chainId } = params;
3623
- const nonce = await publicClient.readContract({
3624
- address: safeAddress,
3625
- abi: SAFE_ABI,
3626
- functionName: "nonce"
3627
- });
3628
- const message = {
3629
- to,
3630
- value,
3631
- data,
3632
- operation: 0,
3633
- safeTxGas: 0n,
3634
- baseGas: 0n,
3635
- gasPrice: 0n,
3636
- gasToken: _viem.zeroAddress,
3637
- refundReceiver: _viem.zeroAddress,
3638
- nonce
3639
- };
3640
- const safeTxHash = _viem.hashTypedData.call(void 0, {
3641
- domain: { chainId, verifyingContract: safeAddress },
3642
- types: SAFE_TX_TYPES,
3643
- primaryType: "SafeTx",
3644
- message
3645
- });
3646
- return {
3647
- chainId,
3648
- safeAddress,
3649
- safeTxHash,
3650
- typedData: {
3651
- domain: { chainId, verifyingContract: safeAddress },
3652
- types: SAFE_TX_TYPES,
3653
- primaryType: "SafeTx",
3654
- message
3655
- }
3656
- };
3657
- }
3658
-
3659
3374
  // src/core/session-owner.ts
3660
3375
 
3661
3376
 
@@ -3758,8 +3473,4 @@ function accountFromPrivateKey(privateKey) {
3758
3473
 
3759
3474
 
3760
3475
 
3761
-
3762
-
3763
-
3764
-
3765
- exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowUpRightIcon = ArrowUpRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.PercentIcon = PercentIcon; exports.ClockIcon = ClockIcon; exports.PlusCircleIcon = PlusCircleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.BankIcon = BankIcon; exports.Callout = Callout; exports.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.ConnectStep = ConnectStep; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.debugLog = debugLog; exports.debugError = debugError; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.ProcessingStep = ProcessingStep; exports.SAFE_ABI = SAFE_ABI; exports.executeSafeEthTransfer = executeSafeEthTransfer; exports.executeSafeErc20Transfer = executeSafeErc20Transfer; exports.buildSafeTransaction = buildSafeTransaction; exports.getPublicClient = getPublicClient; exports.getHyperEvmReadClient = getHyperEvmReadClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;
3476
+ exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowUpRightIcon = ArrowUpRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.PercentIcon = PercentIcon; exports.ClockIcon = ClockIcon; exports.PlusCircleIcon = PlusCircleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.BankIcon = BankIcon; exports.Callout = Callout; exports.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.ConnectStep = ConnectStep; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.debugLog = debugLog; exports.debugError = debugError; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.getHyperEvmReadClient = getHyperEvmReadClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;