Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function useCredentialsList() {
const c = source.find((x) => x.id === vcId);
void c;
const { txId } = await revokeCredential(vcId);
const net = network === 'mainnet' ? 'public' : 'testnet';
const net = network === 'mainnet' ? 'mainnet' : 'testnet';
const url = `https://stellar.expert/explorer/${net}/tx/${txId}`;
toast.success('Credential revoked', {
description: txId,
Expand Down
10 changes: 5 additions & 5 deletions src/components/modules/issue/hooks/useIssueCredential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function useIssueCredential() {

const ownerDid = useMemo(() => {
return walletAddress
? `did:pkh:stellar:${network === 'mainnet' ? 'public' : 'testnet'}:${walletAddress}`
? `did:pkh:stellar:${network === 'mainnet' ? 'mainnet' : 'testnet'}:${walletAddress}`
: undefined;
}, [walletAddress, network]);

Expand Down Expand Up @@ -126,7 +126,7 @@ export function useIssueCredential() {
if (!input) return '';
const trimmed = input.trim();
if (trimmed.startsWith('did:')) return trimmed;
const env = network === 'mainnet' ? 'public' : 'testnet';
const env = network === 'mainnet' ? 'mainnet' : 'testnet';
return `did:pkh:stellar:${env}:${trimmed}`;
};

Expand Down Expand Up @@ -261,7 +261,7 @@ export function useIssueCredential() {
// Impacta Bootcamp template: ensure recipient has a vault via sponsored vault (sponsor = issuer, owner = recipient, did = owner DID).
const isImpactaTemplate = tpl.id === 'impacta-certificate';
if (isImpactaTemplate && !issuingToSelf && ownerG) {
const recipientDid = `did:pkh:stellar:${network === 'mainnet' ? 'public' : 'testnet'}:${ownerG}`;
const recipientDid = `did:pkh:stellar:${network === 'mainnet' ? 'mainnet' : 'testnet'}:${ownerG}`;
try {
await createSponsoredVault({ owner: ownerG, didUri: recipientDid });
} catch (sponsoredErr: unknown) {
Expand Down Expand Up @@ -295,7 +295,7 @@ export function useIssueCredential() {
});

// Prepare issuance: owner = recipient (ownerG), issuer = signer (activeAddress).
const issuerDidLocal = `did:pkh:stellar:${network === 'mainnet' ? 'public' : 'testnet'}:${activeAddress}`;
const issuerDidLocal = `did:pkh:stellar:${network === 'mainnet' ? 'mainnet' : 'testnet'}:${activeAddress}`;
const prep = await actaFetchJson<TxPrepareResp>({
network,
apiKey: trimmedApiKey,
Expand Down Expand Up @@ -324,7 +324,7 @@ export function useIssueCredential() {

setState((s) => ({ ...s, issuing: false, txId: submit.tx_id }));

const net = network === 'mainnet' ? 'public' : 'testnet';
const net = network === 'mainnet' ? 'mainnet' : 'testnet';
const url = `https://stellar.expert/explorer/${net}/tx/${submit.tx_id}`;

toast.success('Credential issued', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useVault } from '@/components/modules/vault/hooks/use-vault';

function extractGFromDid(did?: string): string | null {
if (!did) return null;
const m = did.match(/did:pkh:stellar:(public|testnet):([A-Z0-9]{56})/i);
const m = did.match(/did:pkh:stellar:(mainnet|testnet):([A-Z0-9]{56})/i);
return m ? m[2] : null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/modules/vault/hooks/use-vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function useVault() {

const ownerDid = useMemo(() => {
return walletAddress
? `did:pkh:stellar:${network === 'mainnet' ? 'public' : 'testnet'}:${walletAddress}`
? `did:pkh:stellar:${network === 'mainnet' ? 'mainnet' : 'testnet'}:${walletAddress}`
: null;
}, [walletAddress, network]);

Expand Down
2 changes: 1 addition & 1 deletion src/components/modules/vault/ui/VaultDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function VaultPage() {
(value: string) => {
setSponsorOwnerAddress(value);
if (value) {
const networkId = network === 'mainnet' ? 'public' : 'testnet';
const networkId = network === 'mainnet' ? 'mainnet' : 'testnet';
setSponsorOwnerDid(`did:pkh:stellar:${networkId}:${value}`);
} else {
setSponsorOwnerDid('');
Expand Down