Skip to content

Commit e211b46

Browse files
dozyiomaschad
andauthored
docs: update keychain examples (#2640)
Co-authored-by: Chad Nehemiah <[email protected]>
1 parent 8639494 commit e211b46

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

packages/keychain/src/index.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ export interface Keychain {
9292
* @example
9393
*
9494
* ```TypeScript
95-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
96-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
95+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
96+
* const pemKey = await libp2p.services.keychain.exportKey('keyTest', 'password123')
9797
* ```
9898
*/
9999
exportKey(name: string, password: string): Promise<Multibase<'m'>>
@@ -104,9 +104,9 @@ export interface Keychain {
104104
* @example
105105
*
106106
* ```TypeScript
107-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
108-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
109-
* const keyInfo = await libp2p.keychain.importKey('keyTestImport', pemKey, 'password123')
107+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
108+
* const pemKey = await libp2p.services.keychain.exportKey('keyTest', 'password123')
109+
* const keyInfo = await libp2p.services.keychain.importKey('keyTestImport', pemKey, 'password123')
110110
* ```
111111
*/
112112
importKey(name: string, pem: string, password: string): Promise<KeyInfo>
@@ -117,7 +117,7 @@ export interface Keychain {
117117
* @example
118118
*
119119
* ```TypeScript
120-
* const keyInfo = await libp2p.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
120+
* const keyInfo = await libp2p.services.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
121121
* ```
122122
*/
123123
importPeer(name: string, peerId: PeerId): Promise<KeyInfo>
@@ -128,7 +128,7 @@ export interface Keychain {
128128
* @example
129129
*
130130
* ```TypeScript
131-
* const peerId = await libp2p.keychain.exportPeerId('key-name')
131+
* const peerId = await libp2p.services.keychain.exportPeerId('key-name')
132132
* ```
133133
*/
134134
exportPeerId(name: string): Promise<PeerId>
@@ -139,7 +139,7 @@ export interface Keychain {
139139
* @example
140140
*
141141
* ```TypeScript
142-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
142+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
143143
* ```
144144
*/
145145
createKey(name: string, type: KeyType, size?: number): Promise<KeyInfo>
@@ -150,7 +150,7 @@ export interface Keychain {
150150
* @example
151151
*
152152
* ```TypeScript
153-
* const keyInfos = await libp2p.keychain.listKeys()
153+
* const keyInfos = await libp2p.services.keychain.listKeys()
154154
* ```
155155
*/
156156
listKeys(): Promise<KeyInfo[]>
@@ -161,8 +161,8 @@ export interface Keychain {
161161
* @example
162162
*
163163
* ```TypeScript
164-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
165-
* const keyInfo = await libp2p.keychain.removeKey('keyTest')
164+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
165+
* const keyInfo = await libp2p.services.keychain.removeKey('keyTest')
166166
* ```
167167
*/
168168
removeKey(name: string): Promise<KeyInfo>
@@ -173,8 +173,8 @@ export interface Keychain {
173173
* @example
174174
*
175175
* ```TypeScript
176-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
177-
* const keyInfo = await libp2p.keychain.renameKey('keyTest', 'keyNewNtest')
176+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
177+
* const keyInfo = await libp2p.services.keychain.renameKey('keyTest', 'keyNewNtest')
178178
* ```
179179
*/
180180
renameKey(oldName: string, newName: string): Promise<KeyInfo>
@@ -185,8 +185,8 @@ export interface Keychain {
185185
* @example
186186
*
187187
* ```TypeScript
188-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
189-
* const keyInfo2 = await libp2p.keychain.findKeyById(keyInfo.id)
188+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
189+
* const keyInfo2 = await libp2p.services.keychain.findKeyById(keyInfo.id)
190190
* ```
191191
*/
192192
findKeyById(id: string): Promise<KeyInfo>
@@ -197,8 +197,8 @@ export interface Keychain {
197197
* @example
198198
*
199199
* ```TypeScript
200-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
201-
* const keyInfo2 = await libp2p.keychain.findKeyByName('keyTest')
200+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
201+
* const keyInfo2 = await libp2p.services.keychain.findKeyByName('keyTest')
202202
* ```
203203
*/
204204
findKeyByName(name: string): Promise<KeyInfo>
@@ -209,7 +209,7 @@ export interface Keychain {
209209
* @example
210210
*
211211
* ```TypeScript
212-
* await libp2p.keychain.rotateKeychainPass('oldPassword', 'newPassword')
212+
* await libp2p.services.keychain.rotateKeychainPass('oldPassword', 'newPassword')
213213
* ```
214214
*/
215215
rotateKeychainPass(oldPass: string, newPass: string): Promise<void>

0 commit comments

Comments
 (0)