create-izi-noir 0.2.10 → 0.2.11

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 (2) hide show
  1. package/dist/index.js +181 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -717,7 +717,7 @@ function generateAppTsx(options) {
717
717
  const solanaImports = isSolana ? `
718
718
  import { useWallet } from '@solana/wallet-adapter-react';
719
719
  import { useWalletModal } from '@solana/wallet-adapter-react-ui';
720
- import { Chain, Network } from '@izi-noir/sdk';` : "";
720
+ import { Chain, Network, getExplorerTxUrl, getExplorerAccountUrl } from '@izi-noir/sdk';` : "";
721
721
  const solanaHooks = isSolana ? `
722
722
  const { publicKey, connected, sendTransaction } = useWallet();
723
723
  const { setVisible } = useWalletModal();` : "";
@@ -728,6 +728,7 @@ import { Chain, Network } from '@izi-noir/sdk';` : "";
728
728
  // Deploy state
729
729
  const [isDeploying, setIsDeploying] = useState(false);
730
730
  const [vkAccount, setVkAccount] = useState<string | null>(null);
731
+ const [deployTx, setDeployTx] = useState<string | null>(null);
731
732
  const [deployError, setDeployError] = useState<string | null>(null);
732
733
 
733
734
  // Verify state
@@ -745,6 +746,7 @@ import { Chain, Network } from '@izi-noir/sdk';` : "";
745
746
  try {
746
747
  const result = await iziInstance.deploy({ publicKey, sendTransaction });
747
748
  setVkAccount(result.vkAccount);
749
+ setDeployTx(result.signature);
748
750
  } catch (error) {
749
751
  console.error('Deploy error:', error);
750
752
  setDeployError((error as Error).message);
@@ -764,8 +766,13 @@ import { Chain, Network } from '@izi-noir/sdk';` : "";
764
766
  const result = await iziInstance.verifyOnChain({ publicKey, sendTransaction }, vkAccount);
765
767
  setVerified(result.verified);
766
768
  } catch (error) {
767
- console.error('Verify error:', error);
768
- setVerifyError((error as Error).message);
769
+ const err = error as Error;
770
+ console.error('Verify error details:', {
771
+ message: err.message,
772
+ cause: (err as unknown as { cause?: unknown }).cause,
773
+ stack: err.stack,
774
+ });
775
+ setVerifyError(err.message);
769
776
  } finally {
770
777
  setIsVerifying(false);
771
778
  }
@@ -791,21 +798,62 @@ import { Chain, Network } from '@izi-noir/sdk';` : "";
791
798
  {isDeploying ? 'Deploying...' : vkAccount ? 'Deployed' : 'Deploy VK'}
792
799
  </button>
793
800
  {deployError && <p className="error">{deployError}</p>}
794
- {vkAccount && <p className="success">VK: {vkAccount.slice(0, 8)}...</p>}
801
+ {vkAccount && (
802
+ <div className="deploy-result">
803
+ <div className="deploy-result-item">
804
+ <span className="deploy-label">VK Account:</span>
805
+ <a
806
+ href={getExplorerAccountUrl(Network.Devnet, vkAccount)}
807
+ target="_blank"
808
+ rel="noopener noreferrer"
809
+ className="explorer-link"
810
+ >
811
+ {vkAccount}
812
+ </a>
813
+ </div>
814
+ {deployTx && (
815
+ <div className="deploy-result-item">
816
+ <span className="deploy-label">Transaction:</span>
817
+ <a
818
+ href={getExplorerTxUrl(Network.Devnet, deployTx)}
819
+ target="_blank"
820
+ rel="noopener noreferrer"
821
+ className="explorer-link"
822
+ >
823
+ {deployTx}
824
+ </a>
825
+ </div>
826
+ )}
827
+ </div>
828
+ )}
795
829
  </div>
796
830
 
797
831
  <div className="verify-box">
798
- {publicInputs && (
799
- <div className="public-inputs-display">
800
- <span>Public inputs:</span>
801
- <code>{JSON.stringify(publicInputs)}</code>
832
+ {publicInputs && publicInputs.length > 0 && (
833
+ <div className="claim-card">
834
+ <p className="claim-label">Verifying claim:</p>
835
+ <div className="claim-content">
836
+ <p className="claim-text">
837
+ "I know private values that satisfy the circuit constraints with these public inputs:"
838
+ </p>
839
+ <div className="public-inputs-grid">
840
+ {publicInputs.map((hex, idx) => {
841
+ const decimal = BigInt(hex).toString();
842
+ return (
843
+ <div key={idx} className="public-input-card">
844
+ <span className="input-badge public">public</span>
845
+ <span className="public-input-value">{decimal}</span>
846
+ </div>
847
+ );
848
+ })}
849
+ </div>
850
+ </div>
802
851
  </div>
803
852
  )}
804
853
  <button
805
854
  onClick={handleVerify}
806
855
  disabled={!vkAccount || isVerifying}
807
856
  className="btn btn-primary"
808
- style={{ marginTop: publicInputs ? '0.5rem' : 0 }}
809
857
  >
810
858
  {isVerifying ? 'Verifying...' : verified ? 'Verified!' : 'Verify On-Chain'}
811
859
  </button>
@@ -1526,22 +1574,138 @@ main {
1526
1574
  }
1527
1575
 
1528
1576
  .public-inputs-display {
1529
- margin-top: 0.75rem;
1577
+ margin-bottom: 1rem;
1578
+ }
1579
+
1580
+ .public-inputs-label {
1581
+ display: block;
1530
1582
  font-size: 0.75rem;
1531
1583
  color: var(--text-muted);
1584
+ text-transform: uppercase;
1585
+ letter-spacing: 0.05em;
1586
+ margin-bottom: 0.75rem;
1532
1587
  }
1533
1588
 
1534
- .public-inputs-display code {
1535
- display: block;
1536
- margin-top: 0.5rem;
1537
- padding: 0.75rem;
1589
+ .public-inputs-list {
1590
+ display: flex;
1591
+ flex-direction: column;
1592
+ gap: 0.5rem;
1593
+ }
1594
+
1595
+ .public-input-item {
1596
+ display: flex;
1597
+ align-items: center;
1598
+ gap: 0.75rem;
1599
+ padding: 0.75rem 1rem;
1538
1600
  background: rgba(0, 0, 0, 0.4);
1539
1601
  border: 1px solid var(--border);
1602
+ border-radius: 12px;
1603
+ transition: border-color 0.3s ease;
1604
+ }
1605
+
1606
+ .public-input-item:hover {
1607
+ border-color: rgba(20, 241, 149, 0.3);
1608
+ }
1609
+
1610
+ .public-input-value {
1611
+ font-family: 'JetBrains Mono', monospace;
1612
+ font-size: 1rem;
1613
+ font-weight: 500;
1614
+ color: var(--text);
1615
+ }
1616
+
1617
+ /* ================================
1618
+ Claim Card - Public Inputs Display
1619
+ ================================ */
1620
+ .claim-card {
1621
+ margin-bottom: 1rem;
1622
+ padding: 1rem;
1623
+ background: rgba(20, 241, 149, 0.05);
1624
+ border: 1px solid rgba(20, 241, 149, 0.2);
1625
+ border-radius: 12px;
1626
+ }
1627
+
1628
+ .claim-label {
1629
+ font-size: 0.75rem;
1630
+ color: var(--solana-green);
1631
+ text-transform: uppercase;
1632
+ letter-spacing: 0.1em;
1633
+ font-weight: 600;
1634
+ margin-bottom: 0.75rem;
1635
+ }
1636
+
1637
+ .claim-content {
1638
+ padding: 0.5rem 0;
1639
+ }
1640
+
1641
+ .claim-text {
1642
+ font-size: 0.875rem;
1643
+ color: var(--text-muted);
1644
+ font-style: italic;
1645
+ margin-bottom: 1rem;
1646
+ line-height: 1.5;
1647
+ }
1648
+
1649
+ .public-inputs-grid {
1650
+ display: flex;
1651
+ flex-wrap: wrap;
1652
+ gap: 0.75rem;
1653
+ }
1654
+
1655
+ .public-input-card {
1656
+ display: flex;
1657
+ align-items: center;
1658
+ gap: 0.75rem;
1659
+ padding: 0.75rem 1rem;
1660
+ background: rgba(0, 0, 0, 0.4);
1661
+ border: 1px solid rgba(20, 241, 149, 0.3);
1662
+ border-radius: 12px;
1663
+ transition: border-color 0.3s ease, transform 0.3s ease;
1664
+ }
1665
+
1666
+ .public-input-card:hover {
1667
+ border-color: var(--solana-green);
1668
+ transform: translateY(-2px);
1669
+ }
1670
+
1671
+ .deploy-result {
1672
+ margin-top: 1rem;
1673
+ padding: 1rem;
1674
+ background: rgba(20, 241, 149, 0.05);
1675
+ border: 1px solid rgba(20, 241, 149, 0.2);
1540
1676
  border-radius: 8px;
1677
+ }
1678
+
1679
+ .deploy-result-item {
1680
+ margin-bottom: 0.75rem;
1681
+ }
1682
+
1683
+ .deploy-result-item:last-child {
1684
+ margin-bottom: 0;
1685
+ }
1686
+
1687
+ .deploy-label {
1688
+ display: block;
1689
+ font-size: 0.75rem;
1690
+ color: var(--text-muted);
1691
+ text-transform: uppercase;
1692
+ letter-spacing: 0.05em;
1693
+ margin-bottom: 0.25rem;
1694
+ }
1695
+
1696
+ .explorer-link {
1697
+ display: block;
1541
1698
  font-family: 'JetBrains Mono', monospace;
1542
- font-size: 0.7rem;
1543
- overflow-x: auto;
1544
- max-width: 100%;
1699
+ font-size: 0.75rem;
1700
+ color: var(--solana-green);
1701
+ text-decoration: none;
1702
+ word-break: break-all;
1703
+ transition: color 0.3s ease;
1704
+ }
1705
+
1706
+ .explorer-link:hover {
1707
+ color: var(--solana-purple);
1708
+ text-decoration: underline;
1545
1709
  }
1546
1710
 
1547
1711
  /* ================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-izi-noir",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "CLI to scaffold IZI-NOIR ZK projects",
5
5
  "type": "module",
6
6
  "bin": {