diff --git a/packages/core/src/receipt.js b/packages/core/src/receipt.js index 14314a44..1a6a2238 100644 --- a/packages/core/src/receipt.js +++ b/packages/core/src/receipt.js @@ -105,6 +105,9 @@ class Receipt { return proofs } } + link() { + return this.root.cid + } get meta() { return this.root.data.ocm.meta } diff --git a/packages/core/test/receipt.spec.js b/packages/core/test/receipt.spec.js index 2c05dd8e..993ea399 100644 --- a/packages/core/test/receipt.spec.js +++ b/packages/core/test/receipt.spec.js @@ -32,6 +32,8 @@ test('basic receipt', async () => { await assertRoundtrip(receipt) assert.equal(receipt.buildIPLDView().buildIPLDView(), receipt) + + assert.ok(receipt.link()) }) test('receipt with ran as link', async () => { diff --git a/packages/interface/src/lib.ts b/packages/interface/src/lib.ts index ef325fe8..450b4176 100644 --- a/packages/interface/src/lib.ts +++ b/packages/interface/src/lib.ts @@ -456,6 +456,7 @@ export interface Receipt< readonly signature: SignatureView, Alg> + link(): Link, number, number, 1> verifySignature(signer: Crypto.Verifier): Await> buildIPLDView(): Receipt diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 70dc25fa..63cc9a88 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' settings: autoInstallPeers: false