@myrx-token/mrx-access
v0.1.0
Published
MRxAccess SDK — verify patient identity and credentials against MRxWallet health identity infrastructure
Maintainers
Readme
@myrxwallet/mrx-access
MyRx-Access SDK — verify patient identity and credentials against MyRxWallet health identity infrastructure.
Server-side use only. Never expose your API key in a browser.
- Docs & API keys: https://trinh.io/dev
- Live platform: https://trinh.io
Install
npm install @myrxwallet/mrx-accessQuick Start
import { createMRxClient } from '@myrxwallet/mrx-access';
const mrx = createMRxClient({ apiKey: 'mrx_your_key_here' });
// Verify identity + get trust score in one call
const result = await mrx.access.verify({ wallet: '0x...' });
if (result.accepted) {
console.log(result.mrx_id); // e.g. "ID-3"
console.log(result.mrx_score); // e.g. 720
console.log(result.signature); // HMAC-signed proof
}
// Fetch FHIR R4 resources
const bundle = await mrx.fhir.bundle('0x...');
const meds = await mrx.fhir.medicationStatement('LOT-12345');
// Score helpers
const band = mrx.score.band(result.mrx_score ?? 0); // "Excellent" | "Good" | "Building"
const ok = mrx.score.qualifies(result.mrx_score ?? 0, 500);Classes
MyRx-Access
Identity verification with HMAC-signed receipts.
const access = new MyRx-Access({ apiKey: 'mrx_...' });
const result = await access.verify({
wallet: '0x...',
requires: ['MyRx-ID'],
credentials: ['HIPAA_AUTH'],
assurance: 'HIGH',
});MRxProfile
Full identity profile: score, MRT balance, attestations, NFT.
const profile = new MRxProfile('mrx_...');
const data = await profile.get('0x...');
console.log(data.mrx_score, data.mrt_balance, data.attestations);MRxFHIR
FHIR R4 resources (HL7 4.0.1, US Core, USCDI v3+ compatible).
const fhir = new MRxFHIR('mrx_...');
await fhir.patient('0x...');
await fhir.consent('MyRx-ID-abc123');
await fhir.medicationStatement('LOT-12345');
await fhir.bundle('0x...');
await fhir.metadata();MRxAttestation
Submit and list FHIR-anchored attestations. Contributes to MyRx-Score growth.
const attest = new MRxAttestation('mrx_...');
await attest.submit({
wallet: '0x...',
type: 'ANNUAL_WELLNESS_VISIT',
encounter_id: 'urn:myrxwallet:encounter:ENC-001',
fhir_reference: 'Encounter/ENC-001',
});
const list = await attest.list('0x...');Score Growth Paths
| Event | MRT Awarded | Notes | |-------|------------|-------| | Signup / MyRx-ID mint | +100 MRT | Base identity | | Access verification | +10 MRT | Activity signal | | Attestation added | +25 MRT | Credential depth | | Annual Wellness Visit | +50 MRT | Clinical engagement | | FHIR encounter-anchored | — | CMS CY2027 MA eligible |
Compliance
- Non-custodial: No private keys held.
- Non-transactional: No exchange, payment, or financial function.
- HIPAA-aligned: No PHI in transit or stored by this SDK.
- FHIR R4 / USCDI v3+: All FHIR resources conform to US Core profiles.
- CMS CY2027: Encounter-anchored attestations support MA risk-score documentation.
- DSCSA: MedicationStatement sourced from Section 582-aligned provenance.
- MyRx-Chain-1: Hyperledger Fabric. Standard: MRxNFT-1.0.
MIT — MyRxWallet North America Corporation
