import {Credentials, rpcService, RPCService, certPath, RPCError} from '@keys-pub/chill'
export const creds: Credentials = new Credentials(certPath('Chill'))
export const rpc: RPCService = rpcService('localhost:49405', creds)
// Authenticate with service
const auth = await rpc.authUnlock({
secret: 'mypassword',
type: AuthType.PASSWORD_AUTH,
client: 'myapp',
})
// Set auth token from unlock on the service auth
creds.token = auth.authToken
// Search
const keys = await rpc.keys({})
console.log('Keys:', keys)