Skip to content

Commit f22bbff

Browse files
achingbrainoedstephhuynh18
authored
feat: add support for dag-jose codec (#4028)
`dag-jose` is now supported out of the box without any other configuration required. Closes: ceramicnetwork/.github#207 Co-authored-by: Joel Thorstensson <[email protected]> Co-authored-by: Joel Thorstensson <[email protected]> Co-authored-by: stephhuynh18 <[email protected]>
1 parent b84d8ed commit f22bbff

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@ipld/dag-json": "^8.0.1",
6060
"@ipld/dag-pb": "^2.1.3",
6161
"any-signal": "^3.0.0",
62+
"dag-jose": "^1.0.0",
6263
"debug": "^4.1.1",
6364
"err-code": "^3.0.1",
6465
"ipfs-core-types": "^0.9.0",

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Multihashes } from 'ipfs-core-utils/multihashes'
66
import * as dagPB from '@ipld/dag-pb'
77
import * as dagCBOR from '@ipld/dag-cbor'
88
import * as dagJSON from '@ipld/dag-json'
9+
import * as dagJOSE from 'dag-jose'
910
import { identity } from 'multiformats/hashes/identity'
1011
import { bases, hashes, codecs } from 'multiformats/basics'
1112
import { createBitswap } from './bitswap/index.js'
@@ -80,7 +81,7 @@ export function create (options = {}) {
8081
/** @type {BlockCodec[]} */
8182
const blockCodecs = Object.values(codecs);
8283

83-
[dagPB, dagCBOR, dagJSON, id].concat((options.ipld && options.ipld.codecs) || []).forEach(codec => blockCodecs.push(codec))
84+
[dagPB, dagCBOR, dagJSON, dagJOSE, id].concat((options.ipld && options.ipld.codecs) || []).forEach(codec => blockCodecs.push(codec))
8485

8586
const multicodecs = new Multicodecs({
8687
codecs: blockCodecs,

0 commit comments

Comments
 (0)