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
6 changes: 3 additions & 3 deletions apps/credit-history/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DID_PKH_STELLAR_PREFIX } from '@acta-products/acta/did';
import { DID_STELLAR_PREFIX } from '@acta-products/acta/did';
import {
Button,
Card,
Expand Down Expand Up @@ -72,7 +72,7 @@ export default function Home() {
</CardDescription>
</CardHeader>
<CardContent className="text-xs text-muted-foreground">
Direct cryptographic vault interactions and real-time did:pkh:stellar resolver.
Direct cryptographic vault interactions and real-time did:stellar resolver.
</CardContent>
<CardFooter className="border-t border-border/40 pt-4 flex justify-between items-center">
<Badge variant="outline" className="text-[10px] text-muted-foreground">
Expand All @@ -90,7 +90,7 @@ export default function Home() {
<p className="font-mono">
Identity Method:{' '}
<code className="bg-muted px-1.5 py-0.5 rounded text-foreground">
{DID_PKH_STELLAR_PREFIX}
{DID_STELLAR_PREFIX}
</code>
</p>
<p>Built with Next.js 16, React 19, and Tailwind CSS v4.</p>
Expand Down
10 changes: 5 additions & 5 deletions apps/credit-history/src/components/wallet-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ function truncateAddress(address: string): string {
return `${address.slice(0, 4)}...${address.slice(-4)}`;
}

/** did:pkh:stellar:testnet:GABC...7KQ4 β€” keeps prefix, truncates address */
/** did:stellar:testnet:GABC...7KQ4 β€” keeps prefix, truncates address */
function truncateDid(did: string): string {
const parts = did.split(':');
// did:pkh:stellar:{network}:{address}
if (parts.length < 5) return did;
const prefix = parts.slice(0, 4).join(':');
const addr = parts[4];
// did:stellar:{network}:{address}
if (parts.length < 4) return did;
const prefix = parts.slice(0, 3).join(':');
const addr = parts[3];
return `${prefix}:${addr.slice(0, 4)}...${addr.slice(-4)}`;
}

Expand Down
8 changes: 4 additions & 4 deletions apps/credit-history/src/session/session-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
*
* Network:
* Read from NEXT_PUBLIC_STELLAR_NETWORK (same env var as ActaProvider).
* DID is always derived with didPkhStellar β€” never constructed by hand.
* DID is always derived with didStellar β€” never constructed by hand.
*/

import { createContext, useCallback, useContext, useEffect, useState } from 'react';
import { didPkhStellar } from '@acta-products/acta/did';
import { didStellar } from '@acta-products/acta/did';
import type { StellarNetwork } from '@acta-products/acta/did';
import { getWalletConnector } from './wallet-connector';

Expand All @@ -43,7 +43,7 @@ export interface SessionState {
status: SessionStatus;
/** Stellar G... address, or null when disconnected. */
address: string | null;
/** Full DID in format did:pkh:stellar:{network}:{G...}, or null when disconnected. */
/** Full DID in format did:stellar:{network}:{G...}, or null when disconnected. */
did: string | null;
/** Initiate wallet connection. */
connect: () => Promise<void>;
Expand Down Expand Up @@ -107,7 +107,7 @@ export function SessionProvider({ children }: { children: React.ReactNode }) {
}
}, []);

const did = address !== null ? didPkhStellar(network, address) : null;
const did = address !== null ? didStellar(network, address) : null;

return (
<SessionContext.Provider value={{ status, address, did, connect, disconnect }}>
Expand Down
2 changes: 1 addition & 1 deletion apps/credit-history/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface CreditCredential {
id: string;
category: CreditCategory;
issuerName: string;
issuerDid: string; // format did:pkh:stellar:{network}:{G…}
issuerDid: string; // format did:stellar:{network}:{G…}
issuedAt: string; // ISO timestamp
status: CreditStatus;
claims: Record<string, unknown>; // category-specific data (intentionally loose typing)
Expand Down
6 changes: 3 additions & 3 deletions packages/acta/src/did.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type StellarNetwork = 'testnet' | 'mainnet';

export const DID_PKH_STELLAR_PREFIX = 'did:pkh:stellar';
export const DID_STELLAR_PREFIX = 'did:stellar';

/** Builds the default ACTA DID for a Stellar account, matching acta-api. */
export function didPkhStellar(network: StellarNetwork, address: string): string {
return `${DID_PKH_STELLAR_PREFIX}:${network}:${address}`;
export function didStellar(network: StellarNetwork, address: string): string {
return `${DID_STELLAR_PREFIX}:${network}:${address}`;
}
16 changes: 8 additions & 8 deletions packages/acta/src/mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { didPkhStellar, StellarNetwork } from './did';
import { didStellar, StellarNetwork } from './did';
import type {
CreditCredential,
CreditProfileSummary,
Expand All @@ -18,7 +18,7 @@ export const FIXTURES: CreditCredential[] = [
type: 'IncomeVerification',
title: 'Anchor Payroll Income',
issuer: 'Stellar Anchor Payroll Services',
issuerDid: didPkhStellar(MAINNET, 'GAPAYROLL5ANCHORSVC1234567890ABCDEF1234567890ABCDEF12345'),
issuerDid: didStellar(MAINNET, 'GAPAYROLL5ANCHORSVC1234567890ABCDEF1234567890ABCDEF12345'),
issueDate: '2026-03-01T14:15:00Z',
value: '$45,000 USD / yr',
description: 'Verified recurring salary deposits routed through a registered Stellar Anchor.',
Expand All @@ -39,7 +39,7 @@ export const FIXTURES: CreditCredential[] = [
type: 'EmploymentVerification',
title: 'Full-Time Employment Verification',
issuer: 'WorkVerify DAO',
issuerDid: didPkhStellar(MAINNET, 'GWORKVERIFYDAO9876543210ABCDEF9876543210ABCDEF9876543210'),
issuerDid: didStellar(MAINNET, 'GWORKVERIFYDAO9876543210ABCDEF9876543210ABCDEF9876543210'),
issueDate: '2025-11-10T09:00:00Z',
value: 'Full-Time',
description:
Expand All @@ -60,7 +60,7 @@ export const FIXTURES: CreditCredential[] = [
type: 'MicrofinanceRepayment',
title: 'Microfinance Repayment Record',
issuer: 'Community Microfinance Network',
issuerDid: didPkhStellar(TESTNET, 'GCMFNEWORK1234567890ABCDEF1234567890ABCDEF1234567890ABCD'),
issuerDid: didStellar(TESTNET, 'GCMFNEWORK1234567890ABCDEF1234567890ABCDEF1234567890ABCD'),
issueDate: '2025-08-20T10:30:00Z',
value: '100% On-time',
description: 'Historical repayment record for community micro-loans settled on-chain.',
Expand All @@ -80,7 +80,7 @@ export const FIXTURES: CreditCredential[] = [
type: 'DeFiLoan',
title: 'Soroban DeFi Loan',
issuer: 'Soroban Lending Pool v2',
issuerDid: didPkhStellar(MAINNET, 'GSOROBANLEND2222222222ABCDEF2222222222ABCDEF2222222222AB'),
issuerDid: didStellar(MAINNET, 'GSOROBANLEND2222222222ABCDEF2222222222ABCDEF2222222222AB'),
issueDate: '2024-12-05T08:00:00Z',
value: '$5,000 USD',
description: 'Active DeFi loan issued via a Soroban smart contract lending pool.',
Expand All @@ -101,7 +101,7 @@ export const FIXTURES: CreditCredential[] = [
type: 'UtilityPayment',
title: 'Electric Bill Payment History',
issuer: 'GreenGrid Utility Verifier',
issuerDid: didPkhStellar(MAINNET, 'GGREENGRIDUTILITY3333333333ABCDEF3333333333ABCDEF333333'),
issuerDid: didStellar(MAINNET, 'GGREENGRIDUTILITY3333333333ABCDEF3333333333ABCDEF333333'),
issueDate: '2026-01-15T08:00:00Z',
value: '18 months on-time',
description: 'Consecutive on-time utility payments verified by a registered billing authority.',
Expand All @@ -121,7 +121,7 @@ export const FIXTURES: CreditCredential[] = [
type: 'LegacyCreditLine',
title: 'Traditional Credit Line (Revoked)',
issuer: 'Traditional Financial Services',
issuerDid: didPkhStellar(MAINNET, 'GTRADFINSERVICES8888888888ABCDEF8888888888ABCDEF88888888'),
issuerDid: didStellar(MAINNET, 'GTRADFINSERVICES8888888888ABCDEF8888888888ABCDEF88888888'),
issueDate: '2024-05-10T09:00:00Z',
value: 'Delinquent',
description:
Expand Down Expand Up @@ -155,7 +155,7 @@ function deriveProfileSummary(credentials: CreditCredential[]): CreditProfileSum
scores.length > 0 ? Math.round(scores.reduce((a, b) => a + b, 0) / scores.length) : undefined;

return {
holderDid: didPkhStellar(TESTNET, 'GHOLDERVAULT111222333444555ABCDEF111222333444555ABCDEF11'),
holderDid: didStellar(TESTNET, 'GHOLDERVAULT111222333444555ABCDEF111222333444555ABCDEF11'),
holderName: 'Alex Mercer',
averageScore,
activeCredentialsCount: active.length,
Expand Down
Loading