import { Key, SCP } from '@secretarium/connector';
async function main() {
// We create the new connector context and provide the console as a logger
const context = new SCP({logger: console});
// We create a new connection key or provide an existing one
const myKey = await Key.createKey()
// We start the connection to Klave
const connection = await context.connect('wss://on.klave.network', myKey)
// Check the connection
const isConnected = context.isConnected()
// Check the endpoint
const endpoint = context.getEndPoint()
// Close the connection
context.close()
// Reset the connection
context.reset()
}
main()