@helia/ipns 9.1.4 → 9.1.5-20ba9cf6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +3 -3
- package/dist/src/errors.d.ts +4 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +4 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +7 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/ipns/resolver.js +4 -4
- package/dist/src/ipns/resolver.js.map +1 -1
- package/package.json +2 -2
- package/src/errors.ts +5 -0
- package/src/index.ts +7 -2
- package/src/ipns/resolver.ts +4 -4
- package/dist/typedoc-urls.json +0 -51
package/README.md
CHANGED
|
@@ -176,16 +176,21 @@ of a record that was created elsewhere.
|
|
|
176
176
|
```TypeScript
|
|
177
177
|
import { createHelia } from 'helia'
|
|
178
178
|
import { ipns, ipnsValidator } from '@helia/ipns'
|
|
179
|
-
import {
|
|
179
|
+
import { delegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
|
|
180
180
|
import { CID } from 'multiformats/cid'
|
|
181
181
|
import { multihashToIPNSRoutingKey, marshalIPNSRecord } from 'ipns'
|
|
182
|
+
import { defaultLogger } from '@libp2p/logger'
|
|
182
183
|
|
|
183
184
|
const helia = await createHelia()
|
|
184
185
|
const name = ipns(helia)
|
|
185
186
|
|
|
186
187
|
const ipnsName = 'k51qzi5uqu5dktsyfv7xz8h631pri4ct7osmb43nibxiojpttxzoft6hdyyzg4'
|
|
187
188
|
const parsedCid: CID<unknown, 114, 0 | 18, 1> = CID.parse(ipnsName)
|
|
188
|
-
const delegatedClient =
|
|
189
|
+
const delegatedClient = delegatedRoutingV1HttpApiClient({
|
|
190
|
+
url: 'https://delegated-ipfs.dev'
|
|
191
|
+
})({
|
|
192
|
+
logger: defaultLogger()
|
|
193
|
+
})
|
|
189
194
|
const record = await delegatedClient.getIPNS(parsedCid)
|
|
190
195
|
|
|
191
196
|
const routingKey = multihashToIPNSRoutingKey(parsedCid.multihash)
|